关闭prefetch

vuecli3.0默认会启用prefetch 会将所有js都放到index.html里导致首页加载时间较长,从vue.config.js里关闭
https://cli.vuejs.org/zh/guide/html-and-static-assets.html#prefetch

// vue.config.js
module.exports = {
chainWebpack: config => {
// 移除 prefetch 插件
config.plugins.delete('prefetch')

// 或者
// 修改它的选项:
config.plugin('prefetch').tap(options => {
options[0].fileBlacklist = options[0].fileBlacklist || []
options[0].fileBlacklist.push(/myasyncRoute(.)+?\.js$/)
return options
})
}
}

设置输出目录

// vue.config.js
module.exports = {
outputDir: '../src/wwwroot', //可以设置相对当前目录得相对路径
}

打包关闭map

// vue.config.js
module.exports = {
productionSourceMap: false,
}