1.将main.js、app.vue文件移入views文件夹中,新建分页的文件加未template,文件目录如下:
2.vue.config.js中增加如下配置:
pages: {
'default/index': {
entry: 'src/views/main.js',
template: 'public/index.html',
filename: 'index.html',
chunks: ['chunk-vendors', 'chunk-common', 'default/index']
},
'template1/template1': {
entry: 'src/template/template1/main.js',
template: 'public/template.html',
filename: 'template1.html',
chunks: ['chunk-vendors', 'chunk-common', 'template1/template1']
}
},
3.打包后结果如下: