Skip to content

Commit 5c2c23a

Browse files
logonoffclaude
andcommitted
fix(react-icons): add sideEffects: false to dist/esm/package.json
The generated dist/esm/package.json only contains {"type": "module"}, which shadows the root package.json's "sideEffects": false declaration. Webpack resolves the nearest package.json for each module, so all icons under dist/esm/ are treated as having side effects, breaking tree-shaking and bundling all 2846 icons (~7MB) regardless of usage. Fixes #12313 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c9853de commit 5c2c23a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-icons/scripts/ensureEsmPackageJson.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ const esmPackageJsonPath = join(__dirname, '../dist/esm/package.json');
99
mkdirSync(dirname(esmPackageJsonPath), { recursive: true });
1010

1111
// Write package.json to mark ESM directory as a module
12-
writeFileSync(esmPackageJsonPath, JSON.stringify({ type: 'module' }, null, 2));
12+
writeFileSync(esmPackageJsonPath, JSON.stringify({ type: 'module', sideEffects: false }, null, 2));

0 commit comments

Comments
 (0)