-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig-overrides.js
42 lines (39 loc) · 1001 Bytes
/
config-overrides.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
const {
override,
fixBabelImports,
addLessLoader,
addBabelPlugin,
addWebpackAlias,
} = require('customize-cra');
// const bgColor = '#f2f6ff';
// const defaultColor = '#3E80FB';
// const hoverColor = '#145ce2';
const option = [
// 添加热更新
addBabelPlugin('react-hot-loader/babel'),
addWebpackAlias({
'react-dom': '@hot-loader/react-dom',
}),
// 按需加载
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
}),
// 自定义主题加载less
addLessLoader({
javascriptEnabled: true,
modifyVars: {
// '@primary-color': defaultColor,
'@border-radius-base': '2px',
// '@link-hover-color': hoverColor,
// '@btn-default-border': defaultColor,
// '@btn-default-color': defaultColor,
// '@table-row-hover-bg': bgColor,
// '@item-hover-bg': bgColor,
// '@menu-bg': bgColor,
},
}),
];
/* config-overrides-overrides.js */
module.exports = override(...option);