路由文件:
import Vue from 'vue'
import Router from 'vue-router'
const bindTel = () => import(/* webpackChunkName: "bindTel" */ '@/pages/bindTel')
const inputCode = () => import(/* webpackChunkName: "inputCode" */ '@/pages/inputCode')
const index = () => import(/* webpackChunkName: "index" */ '@/pages/index')
export default new Router({
routes: [
{
path: '/',
name: 'index',
component: index
},
{
path: '/bindTel',
name: 'bindTel',
component: bindTel
}]
})
webpack配置:
webpack.prod.config.js 文件

output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[name].js')
},
网友评论