在项目根目录下构建一个vue.config.js
文件,用来添加多个应用:
module.exports = {
pages: {
index: {
// page 的入口
entry: 'src/entrys/main.js',
// 模板来源
template: 'public/index.html',
// 在 dist/index.html 的输出
filename: 'index.html',
// 当使用 title 选项时,
// template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
title: 'index'
},
blogs: {
entry: 'src/entrys/blogs.js',
template: 'public/blogs.html',
filename: 'blogs.html',
title: 'blogs'
}
}
}
然后重新运行dev
等命令即可。