Skip to content

Commit d499513

Browse files
committed
[bug fix] Fix css rule conflicts from antd
1 parent c8ae8a4 commit d499513

File tree

11 files changed

+535
-173
lines changed

11 files changed

+535
-173
lines changed

bin/post-install.js

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,39 @@
11
/**
22
* post install script
33
*/
4-
const { cp } = require('shelljs')
5-
const { existsSync } = require('fs')
6-
const { resolve } = require('path')
4+
const {
5+
cp
6+
} = require('shelljs')
7+
const {
8+
existsSync
9+
} = require('fs')
10+
const {
11+
resolve
12+
} = require('path')
713
const prePushPath = resolve(__dirname, '../.git/hooks/pre-push')
814
const prePushPathFrom = resolve(__dirname, 'pre-push')
915

1016
if (!existsSync(prePushPath)) {
1117
cp(prePushPathFrom, prePushPath)
1218
}
19+
20+
const replace = require('replace-in-file')
21+
22+
const removeAntdGlobalStyles = () => {
23+
const options = {
24+
files: [`${process.cwd()}/node_modules/antd/lib/style/core/index.less`, `${process.cwd()}/node_modules/antd/es/style/core/index.less`],
25+
from: "@import 'base';",
26+
to: ''
27+
}
28+
29+
replace(options)
30+
.then(() => {
31+
console.log('[INFO] Successfully Removed Antd Global Styles:')
32+
})
33+
.catch(e => {
34+
console.error('[ERR] Error removing Antd Global Styles:', e)
35+
process.exit(1)
36+
})
37+
}
38+
39+
removeAntdGlobalStyles()

0 commit comments

Comments
 (0)