File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @module-federation/enhanced ' : patch
3+ ---
4+
5+ fix(enhanced): Mark all exports as provided, to avoid webpack's export analysis from marking them as unused since we copy buildMeta
Original file line number Diff line number Diff line change 11/*
2- MIT License http://www.opensource.org/licenses/mit-license.php
3- Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy
2+ MIT License http://www.opensource.org/licenses/mit-license.php
3+ Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy
44*/
55
66'use strict' ;
@@ -736,6 +736,10 @@ class ConsumeSharedPlugin {
736736 // This ensures ConsumeSharedModule inherits ESM/CJS detection (exportsType) and other optimization metadata
737737 module . buildMeta = { ...fallbackModule . buildMeta } ;
738738 module . buildInfo = { ...fallbackModule . buildInfo } ;
739+ // Mark all exports as provided, to avoid webpack's export analysis from marking them as unused since we copy buildMeta
740+ compilation . moduleGraph
741+ . getExportsInfo ( module )
742+ . setUnknownExportsProvided ( ) ;
739743 }
740744 }
741745 }
Original file line number Diff line number Diff line change @@ -202,6 +202,9 @@ export const createMockCompilation = () => {
202202 const mockModuleGraph = {
203203 getModule : jest . fn ( ) ,
204204 getOutgoingConnections : jest . fn ( ) . mockReturnValue ( [ ] ) ,
205+ getExportsInfo : jest . fn ( ) . mockReturnValue ( {
206+ setUnknownExportsProvided : jest . fn ( ) ,
207+ } ) ,
205208 } ;
206209
207210 // Cast to any to allow flexible property addition
You can’t perform that action at this time.
0 commit comments