File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @callstack/repack " : patch
3+ ---
4+
5+ Always include AssetRegistry and AssetSourceResolver in the bundle
Original file line number Diff line number Diff line change 1+ /*
2+ * This module is added as an entry module to prevent stripping of these React Native deep imports from the bundle.
3+ * We use require.resolve from Rspack/Webpack to ensure these modules are included even if not directly used.
4+ * This allows us to include the modules into the bundle without evaluating them.
5+ * These modules are required by assetsLoader and should be shared as deep imports when using ModuleFederation.
6+ */
7+
8+ require . resolve ( 'react-native/Libraries/Image/AssetRegistry' ) ;
9+ require . resolve ( 'react-native/Libraries/Image/AssetSourceResolver' ) ;
Original file line number Diff line number Diff line change @@ -57,10 +57,13 @@ export class NativeEntryPlugin implements RspackPluginInstance {
5757 '../modules/InitializeScriptManager.js'
5858 ) ;
5959
60+ const includeModulesPath = require . resolve ( '../modules/IncludeModules.js' ) ;
61+
6062 const nativeEntries = [
6163 ...getReactNativePolyfills ( ) ,
6264 initializeCorePath ,
6365 initializeScriptManagerPath ,
66+ includeModulesPath ,
6467 ] ;
6568
6669 compiler . hooks . entryOption . tap (
You can’t perform that action at this time.
0 commit comments