Tree shaking with Webpack / Typescript #553
Unanswered
williamsdyyz
asked this question in
Q&A
Replies: 2 comments 3 replies
-
Have you entertained the possibility of your bundle analyzer not taking treeshaking into consideration? |
Beta Was this translation helpful? Give feedback.
3 replies
-
Currently Jose takes about 100ms to be required in an AWS lambda function Being able to only require the functions you need could significantly decrease cold starts for many projects: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First of all: Thank you for this library! It's made my life infinitely easier
I have a React site. I'm using Jose to decode and validate a JWT and it works great.
The only problem is the bundle size which according to webpack-bundle-analyzer weighs in at 131.0k KB.
Tree shaking is known to be working in this project so I don't think it's a general problem. Seems to be specific to this library.
I'm importing importSPKI, compactVerify and the type KeyLike, but the bundle analysis shows a lot of files that I wouldn't expect.
Does this look correct? If not do you have any thoughts on how to track down the problem?
tsconfig compilerOptions.module is "ES2020" and I'm importing like this (tried import * as... with same result)
webpack-bundle-analyzer output:

Beta Was this translation helpful? Give feedback.
All reactions