-
Notifications
You must be signed in to change notification settings - Fork 3
/
vue.config.js
47 lines (46 loc) · 1.13 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const useCDN = eval(process.env.USE_CDN);
const cdnData = {
library: {
vue: "Vue",
vuex: "Vuex",
"vue-router": "VueRouter",
axios: "axios",
moment: "moment"
},
css: [],
js: [
"https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.runtime.global.prod.js",
"https://cdn.jsdelivr.net/npm/[email protected]/dist/vuex.global.prod.js",
"https://cdn.jsdelivr.net/npm/[email protected]/dist/vue-router.global.prod.js",
"https://cdn.jsdelivr.net/npm/[email protected]/dist/axios.min.js",
"https://cdn.jsdelivr.net/npm/[email protected]/min/moment-with-locales.min.js"
]
};
module.exports = {
devServer: {
port: 8080
},
productionSourceMap: false,
css: {
sourceMap: false,
loaderOptions: {
less: {
lessOptions: {
javascriptEnabled: true,
modifyVars: {}
}
}
}
},
configureWebpack: {
externals: useCDN ? cdnData.library : []
},
chainWebpack: config => {
config.plugin("html").tap(args => {
const options = args[0];
options.js = useCDN ? cdnData.js : [];
options.css = useCDN ? cdnData.css : [];
return args;
});
}
};