Skip to content

Commit

Permalink
Add brotli compression when natively supported
Browse files Browse the repository at this point in the history
  • Loading branch information
clupprich committed Sep 7, 2019
1 parent d0fa1d1 commit 716ac1d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions package/environments/production.js
Expand Up @@ -18,6 +18,18 @@ module.exports = class extends Base {
})
)

if ('brotli' in process.versions) {
this.plugins.append(
'Compression Brotli',
new CompressionPlugin({
filename: '[path].br[query]',
algorithm: 'brotliCompress',
cache: true,
test: /\.(js|css|html|json|ico|svg|eot|otf|ttf|map)$/
})
)
}

this.plugins.append(
'OptimizeCSSAssets',
new OptimizeCSSAssetsPlugin({
Expand Down

0 comments on commit 716ac1d

Please sign in to comment.