-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-overrides.js
49 lines (44 loc) · 1.17 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
45
46
47
48
const { join } = require('path');
const poststylus = require('poststylus');
const { override, fixBabelImports, addWebpackAlias } = require('customize-cra');
const { RewiredRule } = require('../../index');
const resolve = (dir) => join(__dirname, '.', dir);
module.exports = {
webpack(config, env) {
return override(
addWebpackAlias({
'~': resolve('src')
}),
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: 'css'
}),
function (config) {
// const rule = new RewiredRule(config, {
// modules: true
// });
// rule.useStylus();
const rule = new RewiredRule(config, {
modules: true,
usePoststylus: true,
stylus: {
options: {
use: [
poststylus([
require('postcss-flexbugs-fixes'),
require('autoprefixer')({
flexbox: 'no-2009'
}),
'rucksack-css'
])
]
}
}
});
rule.useStylus();
return config;
}
)(config);
}
};