From 21bd6480c212f551bc13b751c1530d4a22e8a435 Mon Sep 17 00:00:00 2001 From: Evan Yamanishi Date: Tue, 15 Sep 2026 16:20:22 -0400 Subject: [PATCH 1/2] fix: narrow sideEffects globs so unused components tree-shake dist/**/[A-Z]**/index.js and dist/**/[A-Z]**/[A-Z]*.js match nearly every component directory, so webpack treats almost the whole compiled package as side-effecting and won't drop unused barrel exports (e.g. Video, which drags in react-player's per-provider chunks even when unused). These globs replaced two explicit file entries in #932 (2020) to cover CSS Modules side effects. That migration to Emotion is done; src has no remaining *.module.css/scss files, and the one raw CSS import left (VidstackPlayer) is already covered by the **/*.css glob. Dropping the catch-all restores tree-shaking without losing real side-effect coverage. gamut-illustrations had the identical catch-all with no CSS imports at all, so it moves to sideEffects: false, matching gamut-icons/gamut-patterns. Co-Authored-By: Claude Sonnet 5 --- packages/gamut-illustrations/package.json | 5 +---- packages/gamut/package.json | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/gamut-illustrations/package.json b/packages/gamut-illustrations/package.json index 5f57e87cc4..7a713d8e13 100644 --- a/packages/gamut-illustrations/package.json +++ b/packages/gamut-illustrations/package.json @@ -28,8 +28,5 @@ "scripts": { "build": "nx build @codecademy/gamut-illustrations" }, - "sideEffects": [ - "dist/**/[A-Z]**/[A-Z]*.js", - "dist/**/[A-Z]**/index.js" - ] + "sideEffects": false } diff --git a/packages/gamut/package.json b/packages/gamut/package.json index 63a4e70b18..1c3232107a 100644 --- a/packages/gamut/package.json +++ b/packages/gamut/package.json @@ -66,8 +66,6 @@ }, "sideEffects": [ "**/*.css", - "**/*.scss", - "dist/**/[A-Z]**/[A-Z]*.js", - "dist/**/[A-Z]**/index.js" + "**/*.scss" ] } From d1516dc3dae91a286aa1a42908bfa254b156c1bf Mon Sep 17 00:00:00 2001 From: Evan Yamanishi Date: Tue, 15 Sep 2026 16:32:58 -0400 Subject: [PATCH 2/2] version plan --- .nx/version-plans/version-plan-1789504367525.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .nx/version-plans/version-plan-1789504367525.md diff --git a/.nx/version-plans/version-plan-1789504367525.md b/.nx/version-plans/version-plan-1789504367525.md new file mode 100644 index 0000000000..04a9461edb --- /dev/null +++ b/.nx/version-plans/version-plan-1789504367525.md @@ -0,0 +1,6 @@ +--- +gamut-illustrations: patch +gamut: patch +--- + +narrow sideEffects globs so unused components (e.g. Video) tree-shake out of consumer bundles