Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working since I upgraded to Angular 14 #46

Open
unrealxqt opened this issue Jun 21, 2023 · 0 comments
Open

Not working since I upgraded to Angular 14 #46

unrealxqt opened this issue Jun 21, 2023 · 0 comments

Comments

@unrealxqt
Copy link

unrealxqt commented Jun 21, 2023

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(),
  ],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant