How to configure:
NPM I compression webpack plugin - d
install the plug-in and add the following configuration in Vue.Config.JS
(the compression plugin configuration options depend on your personal needs)
configureWebpack: {
plugins: [
new CompressionPlugin({
test: /\.(js|css)?$/i, // Which files to compress
algorithm:'gzip', // Use gzip compression
})
]
}
Problems:
usegzip
to unzip the Vue project report an error:Error: Rule can only have one resource source (provided resource and test + include + exclude).
Cause Analysis:
Webpack version conflict in package.json
Solution:
npm i [email protected] -D
npm i [email protected] [email protected] -D