Why is my webpack bundle.js and vendor.bundle.js so incredibly big?

后端 未结 5 2384
我在风中等你
我在风中等你 2020-12-03 11:29

All my React projects tend to be incredibly large in file size (bundle.js is 4.87 mb and the vendor.bundle.js is 2,87 mb). I have no idea why it is this large. I already hav

5条回答
  •  [愿得一人]
    2020-12-03 11:59

    React expects you to set NODE_ENV to 'production' for production builds, and to run it through Uglify -- this gets rid of a lot of extra verbosity, console logging, etc. Make sure you set that environment variable when building via webpack (e.g. NODE_ENV=production webpack at the command line).

提交回复
热议问题