-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-overrides.js
38 lines (34 loc) · 937 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
/* eslint-disable no-param-reassign */
const { override, fixBabelImports, overrideDevServer } = require('customize-cra');
const { name } = require('./package.json');
const QianKunConfig = () => (config) => {
config.output.library = `${name}-[name]`;
config.output.libraryTarget = 'umd';
config.output.jsonpFunction = `webpackJsonp_${name}`;
config.output.globalObject = 'window';
return config;
};
const devServerConfig = () => (config) => {
config.port = 3001;
config.headers = {
'Access-Control-Allow-Origin': '*',
};
config.historyApiFallback = true;
config.hot = false;
config.watchContentBase = false;
config.liveReload = false;
return {
...config,
};
};
module.exports = {
webpack: override(
QianKunConfig(),
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: 'css',
}),
),
devServer: overrideDevServer(devServerConfig()),
};