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
Read More:
- [Solved] Vue Error: Error: Rule can only have one resource source (provided resource and test + include + ex
- Error: Rule can only have one resource source (provided resource and test + include + exclude)
- [Solved] Error Rule can only have one resource source (provided resource and test + include + exclude)
- [Solved] Error Rule can only have one resource source (provided resource and test + include + exclude)
- [Solved] Vue Project Error: Error: Cannot find module ‘webpack‘ Require stack以及Error: Rule can only have one resource so
- Vue3 Error: [vue/no-multiple-template-root] The template root requires exactly one element
- vue.config.js build Package UglifyJsPlugin to clear console and print console.log Error: `warnings` is not a supported option
- “Failed to load resource: net::ERR_FILE_NOT_FOUND” error. The project created by vue-cli 3.0 can run under dev, and an error is reported after packaging, and the page is blank.
- [Solved] webpack Package Error: ERROR in multi ./src/main.js ./dist/bundle.js Module not found: Error: Can‘t resolv
- Vue2.0: How to Use vue3 api to encapsulate Axios
- Vue Use ‘npm run dev’ Error: Error: Unknown option ‘–inline‘ [How to Solve]
- [Solved] Vue project configurate test environment and package error
- Vue3.0 Use el-dialog visible Error: ‘.sync‘ modifier on ‘v-bind‘ directive is deprecated. Use ‘v-model:pro
- Yarn vue3 modify the name of the source file Error [Solved]
- Vue Package Image Error: Syntax Error: Error: ‘**\node_modules\pngquant-bin\vendor\pngquant.exe‘
- The vue3 project Error: Cannot find module’vue-loader-v16/package.json’
- [vite] Failed to parse source for import analysis because the content contains invalid JS syntax.
- [Solved] Vue uses webpack to package error: Createapp is not a function
- [Solved] Vue item packaging error: Failed to load resource: the server responded with a status of 404 (Not Found)
- After Vue is packaged to the server, the static resource path reports an error