ua-parser-js icon indicating copy to clipboard operation
ua-parser-js copied to clipboard

Add sideEffects=false to package.json

Open denisx opened this issue 9 months ago • 1 comments

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

denisx avatar Feb 28 '25 14:02 denisx