0

I have an react application and it's size is around 8mb, I want to reduce it's size. When I am using weback - p ie production version it is reduced to 4mb but then I am not able to debug it.

Is there any better way to do that.

  • 1
    run webpack with `--json > stats.json`, it will tell you what causes the bundle to be that big. This is a useful visual tool (just drag the stats.json file into it): https://chrisbateman.github.io/webpack-visualizer/ – helb Dec 01 '17 at 12:02
  • 1
    Possible duplicate of [Webpack how to build production code and how to use it](https://stackoverflow.com/questions/35054082/webpack-how-to-build-production-code-and-how-to-use-it) – Sagiv b.g Dec 01 '17 at 12:04
  • 1
    Can you share your `webpack.config.js` file and also the `package.json` or at least dependencies? – U Rogel Dec 01 '17 at 13:01

1 Answers1

0

You are supposed to have different builds for development and production. Production build is going to be minified, so it would be difficult to debug. To reduce the size of your bundle.js further you can try gzipping the file.

I've written an article on the same, Webpack:Get it together!

Hope it would be of some use. Cheers.

Siddharth
  • 1,200
  • 8
  • 13