From d5cabed14d6c7fa1a997a90b98278b0448052f72 Mon Sep 17 00:00:00 2001 From: Till JS Date: Tue, 14 Apr 2026 17:16:19 +0200 Subject: [PATCH] perf(shared-icons): mark package as side-effect-free for tree-shaking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit phosphor-svelte ships a 28 MB lib of per-icon Svelte components and does not declare "sideEffects" in its own package.json. When @mana/shared-icons re-exports that package without its own "sideEffects" hint, Vite/Rollup conservatively assume every transitive module evaluation might matter and cannot aggressively prune unused icons across chunk boundaries. Our re-exports (index.ts: `export * from 'phosphor-svelte'` + a small name→component registry) are pure ESM barrels with no top-level runtime code, so flagging the package as side-effect-free is safe and lets the bundler drop unused icons and skip evaluating the icon-registry module from chunks that only want a named icon. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/shared-icons/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/shared-icons/package.json b/packages/shared-icons/package.json index e591c5790..3092894b8 100644 --- a/packages/shared-icons/package.json +++ b/packages/shared-icons/package.json @@ -4,6 +4,7 @@ "private": true, "description": "Phosphor Icons for all Mana SvelteKit web apps", "type": "module", + "sideEffects": false, "svelte": "./src/index.ts", "main": "./src/index.ts", "types": "./src/index.ts",