-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig-overrides.js
More file actions
40 lines (36 loc) · 1.15 KB
/
config-overrides.js
File metadata and controls
40 lines (36 loc) · 1.15 KB
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
const { addBabelPlugin, addLessLoader } = require('customize-cra');
const path = require('path');
const { paths } = require('react-app-rewired');
const fixBabelImports = (libraryName, options) => {
return [
"import",
Object.assign(
{},
{
libraryName
},
options
),
`fix-${libraryName}-imports`
];
};
module.exports = (config) => {
// // 开发环境加入mock
// if (process.env.NODE_ENV === 'development') {
// config.entry.unshift(path.join(paths.appPath, 'src/mock/index.ts'));
// }
// // babel-polyfill替换react-app-polyfill/ie9解决LocalPrivoder报错
// config.entry.unshift(require.resolve('babel-polyfill'));
// const plugin = fixBabelImports('import', {
// libraryName: 'antd',
// libraryDirectory: 'es',
// style: true,
// });
// config = addBabelPlugin(plugin)(config);
// addLessLoader({
// javascriptEnabled: true,
// localIdentName: '[folder]__[local]--[hash:base64:5]',
// modifyVars: { '@primary-color': '#1DA57A' },
// })(config);
return config;
}