[ui-shared-deps] only compress in production build mode (#65151)

This commit is contained in:
Spencer 2020-05-04 15:09:44 -07:00 committed by GitHub
parent 09deb23b7c
commit 99aed58fe2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,15 +118,19 @@ exports.getWebpackConfig = ({ dev = false } = {}) => ({
new webpack.DefinePlugin({
'process.env.NODE_ENV': dev ? '"development"' : '"production"',
}),
new CompressionPlugin({
algorithm: 'brotliCompress',
filename: '[path].br',
test: /\.(js|css)$/,
}),
new CompressionPlugin({
algorithm: 'gzip',
filename: '[path].gz',
test: /\.(js|css)$/,
}),
...(dev
? []
: [
new CompressionPlugin({
algorithm: 'brotliCompress',
filename: '[path].br',
test: /\.(js|css)$/,
}),
new CompressionPlugin({
algorithm: 'gzip',
filename: '[path].gz',
test: /\.(js|css)$/,
}),
]),
],
});