-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-overrides.js
57 lines (52 loc) · 1.65 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
const path = require('path')
const AntDesignThemePlugin = require('antd-theme-webpack-plugin')
const {override, fixBabelImports, addLessLoader} = require('customize-cra')
const options = {
stylesDir: path.join(__dirname, './src/styles'),
antDir: path.join(__dirname, './node_modules/antd'),
varFile: path.join(__dirname, './src/styles/variables.less'),
mainLessFile: path.join(__dirname, './src/styles/index.less'),
themeVariables: [
'@primary-color',
'@secondary-color',
'@text-color',
'@heading-color',
'@nav-dark-bg',
'@header-text-color',
'@layout-header-background',
'@layout-footer-background',
'@nav-dark-text-color',
'@hor-nav-text-color',
'@nav-header-selected-text-color'
],
indexFileName: 'sagas.js.html',
generateOnce: false // generate color.less on each compilation
}
const overrideProcessEnv = value => config => {
config.resolve.modules = [
path.join(__dirname, 'src')
].concat(config.resolve.modules)
config.plugins.push(new AntDesignThemePlugin(options))
return config
}
module.exports = override(
addLessLoader({
javascriptEnabled: true,
modifyVars: {
'@primary-color': '#f0b90b',
'@secondary-color': '#F1D065',
'@text-color': '#666',
'@heading-color': '#333',
'@nav-dark-bg': '#1E2126',
'@header-text-color': '#bcbcbc',
'@layout-header-background': '#1E2126',
'@layout-footer-background': '#0b0e11',
'@nav-dark-text-color': '#ffffff',
'@hor-nav-text-color': '#bcbcbc',
'@nav-header-selected-text-color': '#fff'
}
}),
overrideProcessEnv({
VERSION: JSON.stringify(require('./package.json').version)
})
)