PKI.js icon indicating copy to clipboard operation
PKI.js copied to clipboard

Improve tree shaking

Open stalniy opened this issue 6 months ago • 0 comments
trafficstars

Why

I need to generate and then read X.509 certificate in browser. I wrote a function which does this and compiled it with:

esbuild --tree-shaking=true --outfile=test-cert.js --format=esm --bundle --main-fields=module,main --minify --sourcemap src/test-cert.ts

the output bundle is 376.9kb

Image

With tree shaking disabled, the output is 396.4kb

What

Change the library structure to enable better tree-shaking support.

stalniy avatar May 09 '25 10:05 stalniy