Created
August 1, 2019 09:19
-
-
Save KartoffelToby/bb4b8664fa2aebfe19a23741d1d08fd4 to your computer and use it in GitHub Desktop.
Angular with Brotli
This file contains hidden or 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
| ... | |
| "architect": { | |
| "build": { | |
| "builder": "@angular-builders/custom-webpack:browser", | |
| "options": { | |
| "customWebpackConfig": { | |
| "path": "./extend.webpack.config.js" | |
| }, | |
| ... |
This file contains hidden or 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 BrotliPlugin = require('brotli-webpack-plugin'); | |
| const CompressionPlugin = require('compression-webpack-plugin'); | |
| module.exports = { | |
| plugins: [ | |
| new BrotliPlugin({ | |
| asset: '[path].br[query]', | |
| test: /\.(js|css|html|svg|eot|woff2|woff|ttf)$/, | |
| minRatio: 0.8 | |
| }), | |
| new CompressionPlugin({ | |
| test: /\.(js|css|html|svg|eot|woff2|woff|ttf)$/, | |
| filename: '[path].gz[query]', | |
| algorithm: 'gzip', | |
| minRatio: 0.8 | |
| }) | |
| ] | |
| } |
This file contains hidden or 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
| npm i @angular-builders/custom-webpack -D | |
| ng build --prod --aot=true --extractCss=false --optimization=true --build-optimizer=true --output-hashing none |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment