Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entry point - webpack.config.js vs vue.config.js

In the webpack.config.js file we can set entry file as below.

    module.exports = (env = {}, argv = {}) => {
        const config = {
            entry: {
                main: './src/js/main.js'                    
            },
        }
    }

But in vue.config.js file, how to declare the entry file? I have checked in doc. but there is property such that.

like image 914
bCliks Avatar asked Oct 12 '18 05:10

bCliks


1 Answers

Vue CLI 3 integrates the webpack-chain library as another way of configuring webpack.

For example, your config file may look like:

chainWebpack: config => {
  // clear the existing entry point
  config
    .entry('main')
      .clear()

  // add your custom entry point
  config
    .entry('main')
      .add('./src/js/main.js')
}

See the section on config entryPoints.

like image 168
Brian Lee Avatar answered Oct 28 '22 04:10

Brian Lee