Add sideEffects=false to package.json#781
Open
denisx wants to merge 2 commits intofaisalman:masterfrom
Open
Conversation
Owner
|
Hi, thanks for the PR. Quick question though, since ua-parser-js/src/main/ua-parser.js Line 1418 in 3d41647 Would that count as a side effect? |
Author
|
It can make effect, it can make no effect. But builders can do its best with this key. |
|
Mm |
Dalek2023
approved these changes
Jan 27, 2026
Dalek2023
approved these changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
feature
Description
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