After production-mode build there is a babel-standalone
module in my bundle. But i never installed this babel-standalone
manually. And it doesn't exist in package.json
either. But i installed the babel-polyfill
in this project, does babel-standalone
come with babel-polyfill? How can i remove this module from bundle so that can reduce the size of production bundle?
The screen shot from webpack-bundle-analyzer
is like:
babel-polyfill
doesn't depend onbabel-standalone
. There is something else that is importing it. You can runnpm ls babel-standalone
oryarn why babel-standalone
to see why it's installed.After figuring out why
babel-standalone
is included in your bundle, if you are sure that neither you nor your dependencies need it (it's used to compile JS code on-the-fly in the browser rather than at build time), you can remove it by using Webpack'snull-loader
: