Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@denisx
Copy link
Contributor

@denisx denisx commented Mar 31, 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

@pi0 pi0 changed the title Add side effects to package.json build: add sideEffects to package.json Mar 31, 2025
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pi0 pi0 merged commit bc0dca8 into unjs:main Mar 31, 2025
2 checks passed
@codecov
Copy link

codecov bot commented Mar 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.86%. Comparing base (19b0e6d) to head (139f017).
Report is 22 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #137       +/-   ##
===========================================
+ Coverage   52.08%   91.86%   +39.77%     
===========================================
  Files           4        3        -1     
  Lines         192       86      -106     
  Branches       43       40        -3     
===========================================
- Hits          100       79       -21     
+ Misses         89        6       -83     
+ Partials        3        1        -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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