std-env icon indicating copy to clipboard operation
std-env copied to clipboard

build: explicitly mark fns to improve tree-shaking

Open pi0 opened this issue 1 year ago • 0 comments

Related to #129

(This PR is mainly for experimenting)

Add explicit /* @__PURE__ */ marks to improve tree-shaking with a roll-up. (it does not fully trust sideEffects: false in package.json only)

This only works if the rollup treeshake option is set to smallest and by default does not change any behavior still!

Due to ESBuild limitations for minify options, we have to disable whitespace modification which means the default size of dist/index.mjs goes from 3.96 kB to 4.86 kB.

rollup repl

pi0 avatar Apr 08 '24 11:04 pi0