babel-plugin-resolve-imports-for-browser
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Babel Resolve: Imports to Browser ESM

Build Status

A Babel 7 compatible transform to convert import paths to browser-compatible source paths. Users of previous module systems are used to using extensionless imports and files from node_modules. This module is designed to make any module loadable by the web module system.

Usage

npm install --save-dev babel-plugin-resolve-imports-for-browser

Update your babel configuration:

{
  "plugins": ["resolve-imports-for-browser"]
}

Now code like this:

import PropTypes from 'prop-types';

Will turn into this:

import PropTypes from 'node_modules/prop-types/index.js';

And code like this:

import { file } from './local-file';

Will turn into this:

import { file } from './local-file.js';

Package Sidebar

Install

npm i babel-plugin-resolve-imports-for-browser

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

7.19 kB

Total Files

8

Last publish

Collaborators

  • tbranyen