Skip to content

Add "sideEffects: false"#386

Closed
denisx wants to merge 1 commit intozpao:trunkfrom
denisx:patch-1
Closed

Add "sideEffects: false"#386
denisx wants to merge 1 commit intozpao:trunkfrom
denisx:patch-1

Conversation

@denisx
Copy link

@denisx denisx commented Jan 22, 2025

Add side effects to package.json, help bundlers cut unused code with treeshake. Good for esm, modules, named imports.

ESM is how files and imports are organized, Side effects is how a bundler can remove obviously unused data from an assembly. Only both make maximum effect.

rollup https://rollupjs.org/configuration-options/#treeshake-modulesideeffects
webpack https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free
esbuild https://esbuild.github.io/plugins/#on-resolve-arguments

@denisx
Copy link
Author

denisx commented Jan 22, 2025

to up #303

@zpao
Copy link
Owner

zpao commented Mar 29, 2025

Thanks for poking at this again and resurfacing. I just merged #303 so going to close this one out.

@zpao zpao closed this Mar 29, 2025
@denisx
Copy link
Author

denisx commented Mar 31, 2025

@zpao waiting for release 🫶

@denisx denisx deleted the patch-1 branch March 31, 2025 12:14
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.

2 participants