通过vue.config.js的page属性设置了两个不同的单页应用入口,在npm run serve模式下运行时正常的,但在npm run build之后用serve -s dist跑服务,不管路由是什么入口始终都使用的是index.html(问题长期有效)
脚手架版本是3.0
相关代码
配置代码
module.exports = {
pages:{
index: {
entry: './src/main.js',
template: './public/index.html',
filename: 'index.html',
chunks: ['chunk-vendors','chunk-common','index']
},
mindex: {
entry: './src/views/Mobile/main.js',
template: './public/mindex.html',
filename: 'mindex.html',
chunks: ['chunk-vendors','chunk-common','mindex']
}
}
}
可单独访问mindex看看是否成功查看原因