GZip doesn't work in Webpack 2.5.1

247 views Asked by At

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 :)

2

There are 2 answers

0
Mihai Lazar On BEST ANSWER
0
PlayMa256 On

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.