1
1
import { SharedConfig , ShareStrategy } from '@module-federation/runtime/types' ;
2
+ import type { sharePlugin } from '@module-federation/sdk' ;
2
3
3
4
export type RemoteEntryType =
4
5
| 'var'
@@ -104,7 +105,7 @@ export interface ShareItem {
104
105
version : string | undefined ;
105
106
scope : string ;
106
107
from : string ;
107
- shareConfig : SharedConfig ;
108
+ shareConfig : SharedConfig & sharePlugin . SharedConfig ;
108
109
}
109
110
110
111
function removePathFromNpmPackage ( packageString : string ) : string {
@@ -157,6 +158,7 @@ function normalizeShareItem(
157
158
| string
158
159
| {
159
160
name : string ;
161
+ import : sharePlugin . SharedConfig [ 'import' ] ;
160
162
version ?: string ;
161
163
shareScope ?: string ;
162
164
singleton ?: boolean ;
@@ -192,6 +194,7 @@ function normalizeShareItem(
192
194
scope : 'default' ,
193
195
from : '' ,
194
196
shareConfig : {
197
+ import : undefined ,
195
198
singleton : false ,
196
199
requiredVersion : version ? `^${ version } ` : '*' ,
197
200
} ,
@@ -203,6 +206,7 @@ function normalizeShareItem(
203
206
version : shareItem . version || version ,
204
207
scope : shareItem . shareScope || 'default' ,
205
208
shareConfig : {
209
+ import : typeof shareItem === 'object' ? shareItem . import : undefined ,
206
210
singleton : shareItem . singleton || false ,
207
211
requiredVersion : shareItem . requiredVersion || ( version ? `^${ version } ` : '*' ) ,
208
212
strictVersion : ! ! shareItem . strictVersion ,
@@ -289,6 +293,7 @@ export type ModuleFederationOptions = {
289
293
singleton ?: boolean ;
290
294
requiredVersion ?: string ;
291
295
strictVersion ?: boolean ;
296
+ import ?: sharePlugin . SharedConfig [ 'import' ] ;
292
297
}
293
298
>
294
299
| undefined ;
0 commit comments