1

I use webpack 2.5.1 and I want to reduce my files size, because my hardware doesn't support files above 7,8 hundred kilobytes. I reduce my main-client.js to 2.63 mb with production mode and uglify, but I want to use gzip and I don't know how...

enter image description here

If I remove CompressionPlugin code I still have 2.63 mb... it doesn't work now... What do I wrong...?


enter image description here

I found this link, but I don't know where to add code from 2.2 -> 4.

Two Quick Ways To Reduce React App’s Size In Production


I accept another methods too, for compressing that js file/s :)

Deadpool
  • 1,031
  • 3
  • 19
  • 35
Alex
  • 1,013
  • 1
  • 13
  • 27

2 Answers2

1

Gziping files is a server feature, you can just enable them in the server that is serving the static files.

I would suggest you to update to webpack 4 and apply code splitting to your code, it will decrease its size.

PlayMa256
  • 6,603
  • 2
  • 34
  • 54