angularwebpackcompressiongzipjscompress

GZip doesn't work in Webpack 2.5.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 :)


Solution

  • that's a server level configuration AFAIK.

    Have a look at https://blogs.msdn.microsoft.com/friis/2017/09/05/iis-dynamic-compression-and-new-dynamic-compression-features-in-iis-10/

    https://httpd.apache.org/docs/2.4/mod/mod_deflate.html

    or

    https://docs.nginx.com/nginx/admin-guide/web-server/compression/

    Depending on the server you are using. In NodeJS if you're using express there's https://github.com/expressjs/compression, and in ASP.NET CORE MVC https://learn.microsoft.com/en-us/aspnet/core/performance/response-compression?view=aspnetcore-2.0&tabs=aspnetcore2x