How can I tell Vue-cli where my app's entrypoint is?

I discovered based on this Github Issue that you can pass a custom entrypoint only in the command line. This is true for both build and serve. See also in the documentation, a single block of code demonstrating this.

Usage: vue-cli-service serve [options] [entry]

I changed my script to

    "serve:ui": "vue-cli-service serve client/src/main.js",

and now it can find the entrypoint.


You can add the entry to the pages option and make sure you include the template too.

vue.config.js

module.exports = {
  pages: {
    app: {
      entry: 'client/src/main.js',
      template: 'client/public/index.html',
    },
  },
};

If you don't like a separate file for this configuration you can also add this to a package.json file:

package.json

  "vue": {
    "pages": {
      "index": {
        "entry": "client/src/main.js",
        "template": "client/public/index.html"
      }
    }
  },