From 73f303f2e2b2f9c85029cf4bc38e095d122ea21e Mon Sep 17 00:00:00 2001 From: dengfuping Date: Fri, 13 Dec 2024 17:03:00 +0800 Subject: [PATCH] optimize(build): Add sideEffects for tree shaking --- packages/charts/package.json | 5 +++++ packages/design/package.json | 5 +++++ packages/icons/package.json | 1 + packages/ui/package.json | 5 +++++ packages/util/package.json | 1 + 5 files changed, 17 insertions(+) diff --git a/packages/charts/package.json b/packages/charts/package.json index 8be73c470..ad3f20d4a 100644 --- a/packages/charts/package.json +++ b/packages/charts/package.json @@ -23,6 +23,11 @@ "README.md", "LICENSE" ], + "sideEffects": [ + "**/*.less", + "**/*.css", + "es/index.js" + ], "scripts": { "build": "NODE_OPTIONS=--max_old_space_size=4096 father build" }, diff --git a/packages/design/package.json b/packages/design/package.json index 9e1819587..d804d596b 100644 --- a/packages/design/package.json +++ b/packages/design/package.json @@ -30,6 +30,11 @@ "README.md", "LICENSE" ], + "sideEffects": [ + "**/*.less", + "**/*.css", + "es/index.js" + ], "scripts": { "build": "father build && cp src/style/reset.css dist/" }, diff --git a/packages/icons/package.json b/packages/icons/package.json index 04c8e139d..0cb739837 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -30,6 +30,7 @@ "README.md", "LICENSE" ], + "sideEffects": false, "scripts": { "build": "npm run generate && father build", "generate": "rm -rf src && ts-node scripts/generate.ts" diff --git a/packages/ui/package.json b/packages/ui/package.json index e1ddc2c07..aef897fc5 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -30,6 +30,11 @@ "README.md", "LICENSE" ], + "sideEffects": [ + "**/*.less", + "**/*.css", + "es/index.js" + ], "scripts": { "build": "NODE_OPTIONS=--max_old_space_size=4096 father build" }, diff --git a/packages/util/package.json b/packages/util/package.json index 7e7ecabef..23deb6d2b 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -27,6 +27,7 @@ "README.md", "LICENSE" ], + "sideEffects": false, "scripts": { "build": "father build" },