babel-plugin-resolve-bower-module
A Babel plugin to resolve ES6 imports that reference Bower modules.
Installation
npm install babel-plugin-resolve-bower-module --save-dev
In your .babelrc
file add the plugin to the plugins
array:
How it works
This plugin will look for import
statements where the module-name
matches a Bower module that is declared as a dependency
or a devDependency
of the project, e.g.
;
will be transformed to something like
;
Options
If the plugin isn't resolving paths correctly or if your bower.json
isn't in process.cwd()
you can pass cwd
as an option to the plugin, e.g. in .babelrc
specify