Created
August 5, 2021 12:41
-
-
Save philippegirard/6bd68209ab748a5d179888fc9cb77c89 to your computer and use it in GitHub Desktop.
production.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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