Vue-cli: Cannot remove or modify default entry point

Created on 13 Aug 2018  路  3Comments  路  Source: vuejs/vue-cli

Version

3.0.0

Node and OS info

Node 8.11.2 / yarn 1.9.4 / Ubuntu 16.04

Steps to reproduce

I want to build multi-page app, but I have no need for default app entry point.
So I'm trying to find a way to remove default entrypoint in vue.config.js.
I found that webpack-chain does not support removing entries, only clearing entry files from entry.
So I tried pages configuration to overwrite app to point to files that make sense in my environment.

What is expected?

I expect to be able to remove default entrypoint or at least I expect pages definition to overwrite default entrypoint.

module.exports = {
  pages: {
    app: {
        entry: 'src/paymentInitiation/paymentInitiation.ts',
        template: 'public/index.html',
        title: 'Payment Initiation',
        filename: 'paymentInitiation.html'
    },
    example: {
      entry: 'src/example/main.ts',
      template: 'public/index.html',
      title: 'Example Vue Page',
      filename: 'example.html'
    }
  }
}

What is actually happening?

Inspect output:

  ...
  entry: {
    app: [
      './src/main.ts'
    ],
    example: [
      '/home/.../webapp/src/example/main.ts'
    ]
  }
}

It would be nice to just be able to redefine/remove it elegantly (setting entrypoints in script in package.json breaks vue ui additional views).

bug typescript

All 3 comments

This should work pretty much like this - maybe you made mistake somewhere, hard to say with just code snippets.

Please provide a github repository with a fresh project containing your configuration changes so we can relaibly replicate what you are experiencing.

Also:

I found that webpack-chain does not support removing entries, only clearing entry files from entry.

Not sure what you are referring to, but should remove an entry:

config.entrypoints.delete('app')

I've tried every combination of .remove() .delete on entries, entry, entryPoints, but never tried entrypoints.
I'll give it a try tomorrow and I'll provide a minimal repo to reproduce it.

Try it:

configureWebpack: config => {
    // Deleting default entry
    delete config.entry.app
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

PrimozRome picture PrimozRome  路  3Comments

jgribonvald picture jgribonvald  路  3Comments

Gonzalo2683 picture Gonzalo2683  路  3Comments

joshuajohnson814 picture joshuajohnson814  路  3Comments

JIANGYUJING1995 picture JIANGYUJING1995  路  3Comments