Skip to content

Instantly share code, notes, and snippets.

@philippegirard
Created August 5, 2021 12:41
Show Gist options
  • Save philippegirard/6bd68209ab748a5d179888fc9cb77c89 to your computer and use it in GitHub Desktop.
Save philippegirard/6bd68209ab748a5d179888fc9cb77c89 to your computer and use it in GitHub Desktop.
production.js
...
const CompressionPlugin = require("compression-webpack-plugin");
environment.plugins.prepend(
"Compression",
new CompressionPlugin({
filename: "[path].br[query]",
algorithm: "brotliCompress",
test: /\.(ts|tsx|js|jsx|css|scss|png|jpeg|jpg|svg|eot|woff|woff2|ttf|otf)$/,
compressionOptions: { level: 11 },
threshold: 10240,
minRatio: 0.8,
deleteOriginalAssets: false,
})
);
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment