-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.config.js
42 lines (38 loc) · 915 Bytes
/
react.config.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
/**
* react config
*
* @see https://cli.vuejs.org/zh/config/
* @see https://github.com/neutrinojs/webpack-chain
*/
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? '.' : '/',
productionSourceMap: false,
css: {
loaderOptions: {
less: {
javascriptEnabled: true,
},
},
},
devServer: {
progress: false,
compress: true,
open: true,
proxy: {
'/api2': {
target: 'https://api.xxx.cn',
},
'/api': {
target: 'http://localhost:8081',
pathRewrite: { '^/api': '' },
},
},
},
chainWebpack: config => {
config.performance.hints(false);
// config.externals({ jquery: 'jQuery' });
// config.target('electron-renderer');
const { ContextReplacementPlugin: crp } = require('webpack');
config.plugin('context-replacement').use(crp, [/moment[\/\\]locale$/, /zh-cn/]);
},
};