Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack 2/bootstrap 4 beta build fails on missing plugin #23620

Closed
peterdutton opened this issue Aug 22, 2017 · 3 comments
Closed

Webpack 2/bootstrap 4 beta build fails on missing plugin #23620

peterdutton opened this issue Aug 22, 2017 · 3 comments

Comments

@peterdutton
Copy link

Hi,

I had an issue with building Bootstrap with Webpack where, after following the Getting Started guide, I was seeing the following error:

ERROR in ./node_modules/bootstrap/dist/js/bootstrap.js Module build failed: ReferenceError: Unknown plugin "transform-es2015-modules-strip" specified in "/home/laptop/webpack-test/node_modules/bootstrap/.babelrc" at 0, attempted to resolve relative to "/home/laptop/webpack-test/node_modules/bootstrap"

However this package does seem to be specified as a dev dependency in the Bootstrap package.json.

To resolve it I had to manually install the plugin in my project, e.g:

npm install babel-plugin-transform-es2015-modules-strip --save-dev

Hopefully this will save others some time, or someone more proficient with npm than me will be able to see what the issue is.

Thanks!

@peternewnham
Copy link

Is the babel loader in your webpack config excluding node_modules? Bootstrap publishes it's .babelrc file so I suspect babel loader is parsing all of your dependencies and using any .babelrc files it comes across.

@peterdutton
Copy link
Author

I wasn't excluding node_modules.
I removed the babel-plugin-transform-es2015-modules-strip package from my project, retried with the exclusion in place and everything works as it should.
Thanks for your help!
Is this a convention that folks would normally know to follow, or is it worth adding to the docs?

@Johann-S
Copy link
Member

It's a best practice to not include node_modules in your babel loader instead of you have the need to build your dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants