Skip to content

chore: add sideEffects: false to package.json#217

Open
rafaumeu wants to merge 1 commit into
developit:mainfrom
rafaumeu:chore/add-side-effects-210
Open

chore: add sideEffects: false to package.json#217
rafaumeu wants to merge 1 commit into
developit:mainfrom
rafaumeu:chore/add-side-effects-210

Conversation

@rafaumeu

Copy link
Copy Markdown

Problem (#210)

mitt has no side effects on import, but package.json does not declare "sideEffects": false. This prevents bundlers (webpack, Rollup, esbuild, Vite) from safely tree-shaking unused exports.

Fix

Add "sideEffects": false to package.json.

This is the standard field recommended by webpack and other bundlers for libraries that are pure (no global side effects when imported).

Allows bundlers to safely tree-shake mitt, since it has no side effects
on import.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant