Open ckken opened 6 months ago
You cannot exclude the @module-federation/webpack-bundler-runtime dependency via external because it is injected via template
使用多个模块联邦的话会有性能问题!
Bundler runtime is stateful I think. It's also quite small. You should look at externalizing the runtime package not the bundler runtime package. That's webpacks runtime code, you want that internalized. Bundler runtime used to be what was in webpacks MF1 runtime modules. Its webpack_require basically.
got it,The runtime package has been externalized. I am considering whether it can also be externalized together to further reduce the size.
I don't think so since it attaches itself to webpack and uses the context of the runtime. But I know we are looking at how to reduce the payload size / allow something like shared for the runtime so if someone has it, others won't load it.
I believe we need to change some of our architecture to support this. But we are planning to look into it.
nice!
Stale issue message
Stale issue message
Should be better once shareable runtime is avaliable
Describe the bug
externals: { ... '@module-federation/webpack-bundler-runtime': 'MFWBR', '@module-federation/webpack-bundler-runtime/constant': 'MFWBRCT', ... },
Reproduction
...
Used Package Manager
pnpm
System Info
Validations