eg: productionGzip: true
(1).打开nginx 配置文件 nginx.conf前端
(2). 开启gzip压缩功能(注意:gzip_static on; 这行命令若是没有 须要加上 )vue
(3)执行保存命令(wq!)webpack
(4)重启nginxnginx
一、先执行nginx测试web
(nginx 路径) -t 根据本身安装目录执行 lnmp 默认路径 : /usr/local/nginx/sbin/nginx -t
二、 执行重启命令 :npm
(nginx 路径) -s reload 根据本身安装目录执行