Add Webpack Compression plugin in prod build
This commit is contained in:
parent
a0f93ae9c3
commit
5e21b9d8ff
2 changed files with 10 additions and 9 deletions
|
|
@ -1,6 +1,9 @@
|
|||
const webpack = require('webpack');
|
||||
const config = require('./webpack.base.js');
|
||||
|
||||
const CompressionPlugin = require("compression-webpack-plugin")
|
||||
|
||||
|
||||
module.exports = Object.assign(
|
||||
config,
|
||||
{
|
||||
|
|
@ -16,6 +19,12 @@ module.exports = Object.assign(
|
|||
{
|
||||
'DEBUG': false
|
||||
} // set a DEBUG flag that can be used in the scripts (can be skipped)
|
||||
}),
|
||||
new CompressionPlugin(
|
||||
{
|
||||
algorithm: "gzip",
|
||||
test: [/\.js$/, /\.svg$/],
|
||||
threshold: 1000
|
||||
})
|
||||
])
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue