4 ms·
Many javascript programmers including library authors don't understand the tree shaking mechanisms available to them. Setting the "sideEffects" property in pack
by reesonz 3y 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-side-effect-free https://webpack.js.org/guides/tree-shaking/#mark-the-file-as...
All popular bundlers (webpack, rollup, esbuild) respect that field.