下载依赖的插件
npm install compression-webpack-plugin -D
配置vue.config.js
1 | const CompressionPlugin = require('compression-webpack-plugin') |
配置nginx
开启gzip1
2gzip on;
gzip_types text/plain application/javascript text/css application/xml text/javascript application/x-javascript;