Open tmkasun opened 2 years ago
The reason for this "unusual" large bundle size is that the web worker storage implementation can not be treeshaked, as what will be used by the web worker in the runtime cannot be determined in the build time.
As per the offline ad-hoc conversations we had, there are several ways to address this concern.
The following are some of the alternative methods I could come up with.
[1] https://github.com/browserify/webworkify
cc: @DonOmalVindula @brionmario
Is your suggestion related to an experience? Please describe.
When we did a bundle analysis in our React app which we use
@asgardeo/auth-react
for auth purposes, It outputs the following result.@asgardeo/auth-react
is consuming +500KB which is bigger than the next biggest chunk in our app. For the comparison, MUI core is under 100KB, React + React-DOM is ~126KBSo IMO +500KB for auth library is an unusually large bundle size.
Describe the improvement
IMHO, We might be packing the resources that
@asgardeo/auth-react
probably not used in the runtime, So if we can do proper Tree shaking we might able to reduce the bundle size by large amount.