You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
868 B
40 lines
868 B
module.exports = {
|
|
chainWebpack: config => {
|
|
// 发布模式
|
|
config.when(process.env.NODE_ENV === 'production', config => {
|
|
config
|
|
.entry('app')
|
|
.clear()
|
|
.add('./src/main-prod.js')
|
|
|
|
config.set('externals', {
|
|
vue: 'Vue',
|
|
'vue-router': 'VueRouter',
|
|
axios: 'axios',
|
|
lodash: '_',
|
|
echarts: 'echarts',
|
|
nprogress: 'NProgress',
|
|
'vue-quill-editor': 'VueQuillEditor'
|
|
})
|
|
|
|
config.plugin('html').tap(args => {
|
|
args[0].isProd = true
|
|
return args
|
|
})
|
|
})
|
|
|
|
// 开发模式
|
|
config.when(process.env.NODE_ENV === 'development', config => {
|
|
config
|
|
.entry('app')
|
|
.clear()
|
|
.add('./src/main-dev.js')
|
|
|
|
config.plugin('html').tap(args => {
|
|
args[0].isProd = false
|
|
return args
|
|
})
|
|
})
|
|
}
|
|
}
|