module-federation-examples: Exposed modules stops working with default webpack 5 optimizations runtimeChunk: 'single'
By adding following to optimizations in webpack config, the exposed module stops working in dependent apps.
splitChunks: {
chunks: 'all',
},
runtimeChunk: 'single'
Output error in module consumer app:
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 32 (9 by maintainers)
@Guriqbal-Singh-Alida Please keep that repo up as is if possible until the plugin can be documented somewhere else. Good job on finding a fix 🎉
For others, this is a plugin that merges the runtimes to get around runtimeChunk: single https://github.com/Guriqbal-Singh-Alida/basic-remote-runtime-single/blob/master/apps/app2/plugins/moduleFedSingleRuntime.js
@Guriqbal-Singh-Alida @maraisr said he would look into it. We are scattered throughout the world though and have day jobs, please be patient. 😄
@Guriqbal-Singh-Alida, I think @ScriptedAlchemy will pull this into the MF org for others to use.
That is very elegant @Guriqbal-Singh-Alida. Good job.
@jacob-ebey i pushed new changes to optimize so that we don’t create an extra file. Also previous solution had a limitation where it did not worked when ran in dev mode, it required the files to be in build folder. Overall please check the new solution. Also probably will create it as plugin unless WMF folks advice otherwise. if possible please update your above comments based on new solution.
But to add; feels that https://github.com/webpack/webpack/pull/11843 should be merged in order to resolve the issue in package itself. It is hanging there from quite a while
@Guriqbal-Singh-Alida, does your company know about sponsors? If it’s something that want quick responses on, I’d honestly point then at sponsoring the webpack organization or Tobias at a level where he would dedicate time for your problems. Let them know if they want people working for them, they should pay them. Otherwise I’d let them know tasks will carry as no one else here cares about their goals or priorities.