forked from eyebluecn/tank-front
-
Notifications
You must be signed in to change notification settings - Fork 0
/
craco.config.js
37 lines (35 loc) · 895 Bytes
/
craco.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
const CracoLessPlugin = require('craco-less');
module.exports = {
devServer: {
port: 6015,
// proxy for local development.
proxy: {
'/api': {
target: 'http://localhost:6010',
changeOrigin: true,
pathRewrite: {
'^/api': '/api'
}
}
},
},
plugins: [
{
// less loader.
plugin: CracoLessPlugin,
options: {
// resolve-url-loader只对sass生效,craco-less默认使用sass配置,所以这里手动过滤掉resolve-url-loader
modifyLessRule: (lessRule) => {
lessRule.use = lessRule.use.filter(i => !i.loader.includes('resolve-url-loader'));
return lessRule;
},
lessLoaderOptions: {
lessOptions: {
modifyVars: {'@primary-color': '#215891'},
javascriptEnabled: true,
},
},
},
},
],
};