-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
76 lines (73 loc) · 2.07 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const custom = {
cdn: {
css: ["//cdn.jsdelivr.net/npm/ant-design-vue@1.7.8/dist/antd.min.css"],
js: [
"//cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.min.js",
// "//cdn.jsdelivr.net/npm/vue-router@3.5.3/dist/vue-router.min.js",
// "//cdn.jsdelivr.net/npm/vuex@3.6.2/dist/vuex.min.js",
"//cdn.jsdelivr.net/npm/moment@2.29.1/min/moment.min.js",
"//cdn.jsdelivr.net/npm/moment@2.29.1/locale/zh-cn.js",
// "//cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js",
"//cdn.jsdelivr.net/npm/ant-design-vue@1.7.8/dist/antd.min.js",
],
},
externals: {
vue: "Vue",
// "vue-router": "VueRouter",
// vuex: "Vuex",
moment: "moment",
// axios: "axios",
"ant-design-vue": "antd",
},
};
const getModifyVars = () => {
const values = {},
vars = [
"@component-background", // "@body-background",
"@layout-body-background",
"@heading-color",
"@text-color",
"@text-color-secondary", // feat:
"@disabled-color",
"@input-placeholder-color",
"@border-color-base",
"@border-color-split",
"@border-color-inverse",
"@primary-1",
"@primary-2",
"@table-expanded-row-bg",
"@page-header-back-color",
"@shadow-color",
"@background-color-light", // feat:
"@background-color-base", // feat:
];
vars.map((item) => (values[item] = `var(--ds-${item.slice(1)})`));
return {
...values,
"@border-radius-base": "2px",
"@card-padding-base": "16px", // 24px
"@body-background": "@component-background",
"@table-header-sort-active-bg": "var(--ds-custom-color-f2f2f2)", // feat:
"@table-header-filter-active-bg": "var(--ds-custom-color-e5e5e5)", // feat:
};
};
module.exports = {
productionSourceMap: false,
css: {
loaderOptions: {
less: {
modifyVars: getModifyVars(),
javascriptEnabled: true,
},
},
},
configureWebpack: {
externals: custom.externals
},
chainWebpack(config) {
config.plugin("html").tap((args) => {
args[0].assets = custom.cdn;
return args;
});
},
};