前端发布优化,部分组件使用cdn资源,不打包

This commit is contained in:
曾阿牛
2020-11-25 02:38:39 +08:00
parent d3dfdace9f
commit 9f1552f508
2 changed files with 16 additions and 0 deletions

View File

@@ -59,6 +59,17 @@ module.exports = {
config
.when(process.env.NODE_ENV !== 'development',
config => {
// 不打包 begin
// 1.目前已经测试通过[vue,axios,echarts]可以cdn引用其它组件测试通过后可继续添加
// 2.此处添加不打包后需在public/index.html head中添加相应cdn资源链接
config.set('externals', {
vue: 'Vue',
axios: 'axios',
echarts: 'echarts'
})
// 不打包 end
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')