Replies: 1 comment 1 reply
-
Ran into the same problems, but somehow this doesn't seem to get any attention... |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I understand that Module Federation cant tree shake a shared resource on build because the module that is running the build can not know what parts of the shared resource other remote modules might need.
However - its seems to me that Module Federation isn't even tree shaking the internals of the shared resource.
Example:
Say im sharing
@shared/index.js
from the example above. While we don't know exactly what the remote modules are going to use from this file, we do know that they can only use what is exported. The rest of the code can safely be tree shaken. In the example above, Module Federation doesn't need to include the entire@shared/utils/utilFunc.js
, just any parts used by exported members of the main shared resource and it deps. In the example above,aDifferentUtil
should be shaken out.Beta Was this translation helpful? Give feedback.
All reactions