Skip to content

Commit 716ac1d

Browse files
committed
Add brotli compression when natively supported
1 parent d0fa1d1 commit 716ac1d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

package/environments/production.js

+12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ module.exports = class extends Base {
1818
})
1919
)
2020

21+
if ('brotli' in process.versions) {
22+
this.plugins.append(
23+
'Compression Brotli',
24+
new CompressionPlugin({
25+
filename: '[path].br[query]',
26+
algorithm: 'brotliCompress',
27+
cache: true,
28+
test: /\.(js|css|html|json|ico|svg|eot|otf|ttf|map)$/
29+
})
30+
)
31+
}
32+
2133
this.plugins.append(
2234
'OptimizeCSSAssets',
2335
new OptimizeCSSAssetsPlugin({

0 commit comments

Comments
 (0)