You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Webpack 2/bootstrap 4 beta build fails on missing plugin #23620
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:
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.
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?
Activity
peternewnham commentedon Aug 22, 2017
Is the babel loader in your webpack config excluding
node_modules? Bootstrap publishes it's.babelrcfile so I suspect babel loader is parsing all of your dependencies and using any.babelrcfiles it comes across.peterdutton commentedon Aug 22, 2017
I wasn't excluding
node_modules.I removed the
babel-plugin-transform-es2015-modules-strippackage 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 commentedon Aug 22, 2017
It's a best practice to not include
node_modulesin your babel loader instead of you have the need to build your dependencies