3.0.5
https://github.com/heguichuan/vuecli3-issue
Node 8.11.3 / Windows 7
npm install
npm run modern
// i init project with vue-cli3 , just add vue.config.js with something in it.
build successfully.
vue-cli-service build --modern
This happens because that plugin is only added for the modern bundle, not the legacy bundle.
https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/config/app.js#L155-L171
You should be able to fix your config like this:
module.exports = {
chainWebpack: config => {
if (config.plugins.has('prefetch')) {
config.plugin('prefetch').tap(options => {
options[0].fileBlacklist = options[0].fileBlacklist || []
options[0].fileBlacklist.push(/myasyncRoute(.)+?/)
return options
})
}
}
}
This happens because that plugin is only added for the modern bundle, not the legacy bundle.
https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/config/app.js#L155-L171
You should be able to fix your config like this:
module.exports = { chainWebpack: config => { if (config.plugins.has('prefetch')) { config.plugin('prefetch').tap(options => { options[0].fileBlacklist = options[0].fileBlacklist || [] options[0].fileBlacklist.push(/myasyncRoute(.)+?/) return options }) } } }
done it!, Thanks!
Most helpful comment
This happens because that plugin is only added for the modern bundle, not the legacy bundle.
https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/config/app.js#L155-L171
You should be able to fix your config like this: