Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark the module as side-effect-free #58

Closed
EvgenyOrekhov opened this issue Aug 25, 2020 · 3 comments · Fixed by #59
Closed

Mark the module as side-effect-free #58

EvgenyOrekhov opened this issue Aug 25, 2020 · 3 comments · Fixed by #59

Comments

@EvgenyOrekhov
Copy link

See https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free.

This will allow a more efficient tree-shaking.

@prettymuchbryce
Copy link
Owner

Thanks @EvgenyOrekhov. I was not aware of this.

@EvgenyOrekhov
Copy link
Author

Not sure whether it had an actual effect. BundlePhobia reports that every individual export is 3 KB: https://bundlephobia.com/[email protected].

@prettymuchbryce
Copy link
Owner

I don't think it did. I think this is due to exporting the StatusCodes and ReasonPhrases as enums which causes the whole enum to be bundled.

I think it may be possible to support enums while also taking better advantage of tree shaking.

Some more discussion of this happening in #55.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants