Tree shaking & shared deps - Solved #3128
Replies: 1 comment
-
Update: So tldr, to maybe help someone in the near future, Any shared package on the webpack.config.js under the ModuleFederationPlugin wont be tree shaken. This causes bundle size issues with certain libs e.g. a Component Library with a ton of assets Reason: some examples here have shared deps out of the box in the webpack config and if we're following the same example without questioning that, it will lead to this use case, so keep your eyes opened on those examples! |
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
-
I have setup a couple of Microfrontends working together and they have in common, a component library built in with React.
I transpile with tsc, having also tested with rollup.
The tree shaking done is working properly and ive analyzed it to see reflect the changes based on the imports but when that same component library is used within webpack context it seems to bundle the entire package.
The only major difference i seem to notice is the webpack build.
Id risk saying that im probably missing something within my webpack config.
Beta Was this translation helpful? Give feedback.
All reactions