-
Notifications
You must be signed in to change notification settings - Fork 461
/
Copy pathconfig-overrides.js
44 lines (43 loc) · 1.04 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
const {
override,
addDecoratorsLegacy,
disableEsLint,
addBundleVisualizer,
addWebpackAlias,
adjustWorkbox,
addLessLoader,
fixBabelImports,
overrideDevServer
} = require('customize-cra');
const path = require('path');
const { addMockServer } = require('./mock-server');
module.exports = {
webpack: override(
addDecoratorsLegacy(),
disableEsLint(),
addBundleVisualizer({}, true),
addWebpackAlias({
'@': path.resolve(__dirname, 'src'),
components: path.resolve(__dirname, 'src/components'),
assets: path.resolve(__dirname, 'src/assets')
}),
adjustWorkbox(wb =>
Object.assign(wb, {
skipWaiting: true,
exclude: (wb.exclude || []).concat('index.html')
})
),
fixBabelImports('import', {
libraryName: 'antd',
style: true
}),
addLessLoader({
localIdentName: '[local]--[hash:base64:8]',
javascriptEnabled: true,
modifyVars: {}
})
),
devServer: overrideDevServer(
process.env.MOCK === 'SERVER' ? addMockServer() : null
)
};