module-federation-examples icon indicating copy to clipboard operation
module-federation-examples copied to clipboard

externals @module-federation/webpack-bundler-runtime no work

Open ckken opened this issue 1 year ago • 1 comments

externals:{
// work
'@module-federation/runtime': 'GLobalLib.MFRuntime',
'@module-federation/sdk': 'GLobalLib.MFSDK',
// no work
 '@module-federation/webpack-bundler-runtime': 'GLobalLib.MFWPR',
'@module-federation/webpack-bundler-runtime/constant': 'GLobalLib.MFWPR_CONSTANT'
}

ckken avatar Apr 23 '24 03:04 ckken

It cant be external, it IS webpack runtime. Making it external pretty much deletes all the federation runtime module code.

bundler runtime is what RuntimeModule binds to, it use to be inside the webpack runtime. So it cant be external

You also cannot share this across other instances. We rely on require.federation.bundlerRuntime - this has to be 1 per runtime, if you try to share it - it will break other things as it cannot share instances

ScriptedAlchemy avatar Apr 24 '24 21:04 ScriptedAlchemy