1 Star 1 Fork 1

刘士朋 / vue_shop

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 935 Bytes
一键复制 编辑 原始数据 按行查看 历史
刘士朋 提交于 2021-10-04 18:15 . 把开发和生产分开
// 项目优化
module.exports = {
// 发布模式
chainWebpack: config => {
config.when(process.env.NODE_ENV === 'production', config => {
config.entry('app').clear().add('./src/main-prod.js')
// 通过CDN加载
config.set('externals', {
vue: 'Vue',
axios: 'axios',
echarts: 'echarts',
"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
})
})
}
}
JavaScript
1
https://gitee.com/liu-shipeng/vue_shop.git
git@gitee.com:liu-shipeng/vue_shop.git
liu-shipeng
vue_shop
vue_shop
main

搜索帮助

53164aa7 5694891 3bd8fe86 5694891