vue优化之加快首屏加载速度
程序员文章站
2022-06-25 09:04:06
一、依赖优化之 CDN 加速减少app.js和vender.js的体积,加快加载速度二、gzip暴力压缩1.npm安装npm i compression-webpack-plugin@1.1.12 --save-dev2.配置,config里的index.js文件 build: { // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all sta...
一、依赖优化之 CDN 加速
减少app.js和vender.js的体积,加快加载速度
二、gzip暴力压缩
1.npm安装npm i compression-webpack-plugin@1.1.12 --save-dev
2.配置,config里的index.js文件
build: {
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: true, //设置为true,之前时false 改为true
productionGzipExtensions: ['js', 'css'],
}
三、路由懒加载
{
path: '/list',
name: 'list',
component:resolve => require(["@/components/list"],resolve)
},
本文地址:https://blog.csdn.net/danruWang/article/details/107359245
上一篇: Python中psutil模块使用汇总
下一篇: C++读写文件