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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With