Better HN
topnewbestaskshowjobs
Log inSign up

reesonz

4 karma · joined Apr 27, 2023 (3y ago) · 1 submissions

Submissions

comment 3y ago · link · parent

Many javascript programmers including library authors don't understand the tree shaking mechanisms available to them. Setting the "sideEffects" property in package.json can be very effective in detailing whether to include/exclude an entire module or certain source files:

https://webpack.js.org/guides/tree-shaking/#mark-the-file-as...

All popular bundlers (webpack, rollup, esbuild) respect that field.