vue-cli-4

vue-cli4 for multi-page use `indexPath`in `pages` config


I'm using vue-cli4 for multi-page, and I want to be able to use indexPathin pages config. How to do that?


Solution

  • I personally use the filename key in pages object.

    module.exports = {
      outputDir: "custom_dist",
      pages: {
        admin: {
          entry: "src/admin/main.js",
          template: "src/admin/template.html",
          filename: "admin/index.html", // >> custom_dist/admin/index.html
       // filename: "../admin_dist/index.html", // >> admin_dist/index.html
        }
      },
    }