Hacker News new | ask | show | jobs
by reesonz 1153 days ago
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.