Skip to content

Commit

Permalink
[ui-shared-deps] only compress in production build mode (#65151)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer authored May 4, 2020
1 parent 09deb23 commit 99aed58
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions packages/kbn-ui-shared-deps/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)$/,
}),
]),
],
});

0 comments on commit 99aed58

Please sign in to comment.