Skip to content

Improve tree shaking #443

@stalniy

Description

@stalniy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions