brotli-webpack-plugin icon indicating copy to clipboard operation
brotli-webpack-plugin copied to clipboard

Not working since I upgraded to Angular 14

Open unrealxqt opened this issue 1 year ago • 0 comments

Hi,

I used to have an Angular 11 project which was working well with brotli, right after the prod build it created the .br files in the dist folder as it supposed to.

However now that I have upgraded my application to Angular 14 brotli just stopped working and it only generates the pure javascript files which are like 9 times bigger than the old compressed one.

Do you have any guide or tips on how to make brotli compression work with Angular 14?

Tried with 2 different webpack configs, none worked:

var BrotliPlugin = require('brotli-webpack-plugin');
module.exports = {
	plugins: [
		new BrotliPlugin({
			asset: '[path].br[query]',
			test: /\.(js|css|html|svg)$/,
			threshold: 10240,
			minRatio: 0.8
		})
	]
}
const CompressionPlugin = require("compression-webpack-plugin");
const BrotliPlugin = require("brotli-webpack-plugin");

module.exports = {
  plugins: [
    new CompressionPlugin({
      algorithm: "gzip"
    }),
    new BrotliPlugin(),
  ],
};

unrealxqt avatar Jun 21 '23 11:06 unrealxqt