Skip to content

Commit 1df94cb

Browse files
committed
Ant Design added
1 parent a6b0928 commit 1df94cb

File tree

4 files changed

+4170
-406
lines changed

4 files changed

+4170
-406
lines changed

reactjs/config-overrides.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const tsImportPluginFactory = require('ts-import-plugin')
2+
const {
3+
getLoader
4+
} = require("react-app-rewired");
5+
const rewireLess = require('react-app-rewire-less');
6+
7+
8+
module.exports = function override(config, env) {
9+
const tsLoader = getLoader(
10+
config.module.rules,
11+
rule =>
12+
rule.loader &&
13+
typeof rule.loader === 'string' &&
14+
rule.loader.includes('ts-loader')
15+
);
16+
17+
tsLoader.options = {
18+
getCustomTransformers: () => ({
19+
before: [tsImportPluginFactory({
20+
libraryDirectory: 'es',
21+
libraryName: 'antd',
22+
style: true,
23+
})]
24+
})
25+
};
26+
27+
config = rewireLess.withLoaderOptions({
28+
javascriptEnabled: true,
29+
modifyVars: {
30+
"@primary-color": "#1DA57A"
31+
},
32+
})(config, env);
33+
34+
return config;
35+
}

0 commit comments

Comments
 (0)