File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 7
7
< meta name ="viewport " content ="width=device-width,initial-scale=1.0 ">
8
8
< link rel ="icon " href ="<%= BASE_URL %>favicon.ico ">
9
9
< title > GIN-VUE-ADMIN</ title >
10
+ < % if(process.env.NODE_ENV!=='development'){ %>
11
+ < script src ="//cdn.staticfile.org/vue/2.6.10/vue.min.js "> </ script >
12
+ < script src ="//cdn.staticfile.org/axios/0.19.0/axios.min.js "> </ script >
13
+ < script src ="//cdn.staticfile.org/echarts/4.7.0/echarts.min.js "> </ script >
14
+ < % } %>
10
15
</ head >
11
16
12
17
< body >
Original file line number Diff line number Diff line change @@ -59,6 +59,17 @@ module.exports = {
59
59
config
60
60
. when ( process . env . NODE_ENV !== 'development' ,
61
61
config => {
62
+
63
+ // 不打包 begin
64
+ // 1.目前已经测试通过[vue,axios,echarts]可以cdn引用,其它组件测试通过后可继续添加
65
+ // 2.此处添加不打包后,需在public/index.html head中添加相应cdn资源链接
66
+ config . set ( 'externals' , {
67
+ vue : 'Vue' ,
68
+ axios : 'axios' ,
69
+ echarts : 'echarts'
70
+ } )
71
+ // 不打包 end
72
+
62
73
config
63
74
. plugin ( 'ScriptExtHtmlWebpackPlugin' )
64
75
. after ( 'html' )
You can’t perform that action at this time.
0 commit comments