I am attempting to populate a dist folder with the standard files along with their .gz versions. To achieve this, I used ng eject
to obtain the webpack.config.js
file in order to integrate the compression plugin from https://github.com/webpack-contrib/compression-webpack-plugin. I added new CompressPlugin({})
as the last plugin and set ejected: false
in the .angular-cli.json
file.
However, upon running ng build
, I noticed that no .gzip/.gz files were being generated as expected.
Could there be something crucial that I might have overlooked or done incorrectly? The full webpack file (mostly auto-generated by ng new
) is provided below:
(Webpack configuration code here)
I am currently using @angular/cli
version 1.4.4
.
The primary reason behind my efforts is to address certain SEO recommendations, specifically because my vendor.css file is flagged at 600Kb in PageSpeed Insights as a blocking CSS resource causing delays in page rendering. This file contains third-party styles such as Bootstrap and Font Awesome. In an attempt to mitigate this, I considered implementing compression. Additionally, I assumed that the web server would automatically compress and serve .gz files, although I'm unsure if this assumption holds true.
Your assistance on this matter would be greatly appreciated. Thank you!