修改Vue的配置文件vue.config.js

module.exports = {
  ...
  pages: {
    index: {
      entry: 'src/main.js',
      template: 'public/index.html',
      filename: 'index.html'
    },
    new: {
      entry: 'src/main-new.js',
      template: 'public/index-new.html',
      filename: 'new.html'
    }
  },
  ...
}
  • entry - 指定主程序路径
  • template - 指定#app所在的html页面路径
  • filename - 指定网页访问时路径

如此配置之后,两个入口分别如下

  • http://localhost:3001/#/index
  • http://localhost:3001/new.html#/index

# To Be Continued!😎

Last Updated: 12/24/2020, 3:30:09 PM