0

I am trying out Module Federation with our Angular application in a large monorepo. We have a library contains dozen of shared components which based on Angular Materials and we use Angular CDK, rxjs in them. When I try to expose one of feature module which uses some shared components, after build, I can see a long list of chunk file generatedchunk file list

shared list (except my own library): enter image description here

I am using: Angular v15 Angular Material v15 Angular CDK v15 rxjs V7 WebPack v5

My question is:

  1. is it expected to generate so many chunk?
  2. can I combine those chunk together by some criteria, for example, I would like all rxjs chunks combined into one single file?
  3. how to choose which library should be shared in a federated module except angular core libraries?

If my question is not clear, please let me know, I will add more details.

I've tried "cacheGroups" of webpack to combine chunks but failed. Seems webpack skips that for shared library.

I've tried different combination of shared libraries, some works, some will throw exception. I have no idea what the guideline to follow to choose libraries that is mandatory to share.

biihc2000
  • 1
  • 1

0 Answers0