-
Notifications
You must be signed in to change notification settings - Fork 5
/
config-overrides.js
104 lines (100 loc) · 2.59 KB
/
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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
const { override, fixBabelImports, addLessLoader, addWebpackModuleRule, addWebpackPlugin, setWebpackOptimizationSplitChunks } = require('customize-cra');
const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin');
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
}),
addWebpackModuleRule({
// test: /components\/.*\.scss$/,
test: /\.scss$/,
include: /components/,
exclude: /node_modules/,
use: [
"style-loader",
{
loader: "css-loader",
options: {
importLoaders: 1,
modules: true,
// localIdentName: "[local]__[hash:base64:5]",
localIdentName: '[path][name]__[local]__[hash:base64:5]'
}
},
'sass-loader'
]
}),
addLessLoader({
javascriptEnabled: true,
modifyVars: {
'@primary-color': '#1B1C2E',
'@text-color':'#FFFFFF',
'@component-background': '#303147',
'@body-background':'#1B1C2E',
'@background-color-light':'#1B1C2E',
'@background-color-base':'#1B1C2E'
},
}),
addWebpackPlugin(new AntdDayjsWebpackPlugin()),
setWebpackOptimizationSplitChunks({
chunks: 'async',
minSize: 30000,
maxSize: 0,
minChunks: 1,
maxAsyncRequests: 20,
maxInitialRequests: 10,
automaticNameDelimiter: '~',
name: true,
cacheGroups: {
antdesign: {
name: 'antdesign',
chunks: 'all',
test: /[\\/]node_modules[\\/](@ant-design|antd)[\\/]/,
priority: -10,
},
ethers: {
name: 'ethers',
chunks: 'all',
test: /[\\/]node_modules[\\/](ethers-wan)[\\/]/,
priority: -11,
},
wlchn: {
name: 'wlchn',
chunks: 'all',
test: /[\\/]node_modules[\\/](@wlchn)[\\/]/,
priority: -11,
},
wansdk: {
name: 'wansdk',
chunks: 'all',
test: /[\\/]node_modules[\\/](ethers-wan)[\\/]/,
priority: -11,
},
mimedb: {
name: 'mimedb',
chunks: 'all',
test: /[\\/]node_modules[\\/](mime-db)[\\/]/,
priority: -11,
},
psl: {
name: 'psl',
chunks: 'all',
test: /[\\/]node_modules[\\/](psl)[\\/]/,
priority: -11,
},
immutable: {
name: 'psl',
chunks: 'all',
test: /[\\/]node_modules[\\/](immutable)[\\/]/,
priority: -11,
},
react: {
name: 'psl',
chunks: 'all',
test: /[\\/]node_modules[\\/](react-dom|redux-form|core-js|ajv)[\\/]/,
priority: -11,
}
},
}),
);