Skip to content

Commit f43af75

Browse files
authored
fix: antd css dependencies in build (#21)
1 parent 01d05f4 commit f43af75

File tree

3 files changed

+388
-568
lines changed

3 files changed

+388
-568
lines changed

packages/apsara-ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@
6161
"file-loader": "^6.1.1",
6262
"less": "^3.12.2",
6363
"less-loader": "^7.0.1",
64-
"rollup": "^2.27.0",
64+
"rollup": "^2.58.0",
6565
"rollup-plugin-multi-input": "^1.1.1",
6666
"rollup-plugin-peer-deps-external": "^2.2.3",
67-
"rollup-plugin-postcss": "^3.1.8",
67+
"rollup-plugin-postcss": "^4.0.1",
6868
"rollup-plugin-postcss-webpack-alias-less-loader": "^1.0.0",
6969
"rollup-plugin-typescript2": "^0.27.2",
7070
"style-loader": "^1.2.1",

packages/apsara-ui/rollup.config.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import multiInput from "rollup-plugin-multi-input";
33
import typescript from "rollup-plugin-typescript2";
44
import tsImportPluginFactory from "ts-import-plugin";
55
import peerDepsExternal from "rollup-plugin-peer-deps-external";
6+
import postcss from "rollup-plugin-postcss";
67
import svgr from "@svgr/rollup";
78
import json from "@rollup/plugin-json";
89
import url from "@rollup/plugin-url";
@@ -29,8 +30,14 @@ export default {
2930
sourcemap: true,
3031
},
3132
],
33+
external: [
34+
// Make antd library styles to be external to current project
35+
/^antd[.]*/,
36+
],
3237
plugins: [
3338
multiInput(),
39+
// Prevents Rollup from bundling the peer dependencies
40+
peerDepsExternal(),
3441
url({
3542
// by default, rollup-plugin-url will not handle font files
3643
include: ["**/*.woff", "**/*.woff2", "**/*.otf", "**/*.ttf"],
@@ -39,9 +46,6 @@ export default {
3946
limit: Infinity,
4047
sourceDir: path.join(__dirname, "assets"),
4148
}),
42-
43-
// Prevents Rollup from bundling the peer dependencies
44-
peerDepsExternal(),
4549
// Transpiles our TypeScript code into JavaScript
4650
typescript({
4751
clean: true,
@@ -62,5 +66,6 @@ export default {
6266
}),
6367
svgr(),
6468
json(),
69+
postcss(),
6570
],
6671
};

0 commit comments

Comments
 (0)