路由懒加载
// bad!
import Wrapper from '@/layout/components/Wrapper/index.vue'
// good!
const Wrapper = () => import('@/layout/components/Wrapper/index.vue')
优化前:
优化后:
webpack
1. productionSourceMap
// vue.config.js
module.exports = {
...
// source map 设置为false以加速生产环境构建
productionSourceMap: isProd ? false : true,
}