@@ -225,39 +225,44 @@ export function patchBundlerConfig<T extends Bundler>(options: {
225
225
bundlerConfig : BundlerConfig < T > ;
226
226
isServer : boolean ;
227
227
modernjsConfig : UserConfig < AppTools > ;
228
+ bundlerType : Bundler ;
228
229
mfConfig : moduleFederationPlugin . ModuleFederationPluginOptions ;
229
230
} ) {
230
- const { bundlerConfig, modernjsConfig, isServer, mfConfig } = options ;
231
+ const { bundlerConfig, modernjsConfig, isServer, mfConfig, bundlerType } =
232
+ options ;
231
233
const enableSSR = Boolean ( modernjsConfig . server ?. ssr ) ;
232
234
233
235
delete bundlerConfig . optimization ?. runtimeChunk ;
234
236
235
237
patchIgnoreWarning ( bundlerConfig ) ;
236
238
237
- bundlerConfig . watchOptions = bundlerConfig . watchOptions || { } ;
238
- if ( ! Array . isArray ( bundlerConfig . watchOptions . ignored ) ) {
239
- if ( bundlerConfig . watchOptions . ignored ) {
240
- bundlerConfig . watchOptions . ignored = [
241
- bundlerConfig . watchOptions . ignored as string ,
242
- ] ;
243
- } else {
244
- bundlerConfig . watchOptions . ignored = [ ] ;
239
+ if ( bundlerType === 'webpack' ) {
240
+ bundlerConfig . watchOptions = bundlerConfig . watchOptions || { } ;
241
+ if ( ! Array . isArray ( bundlerConfig . watchOptions . ignored ) ) {
242
+ if ( bundlerConfig . watchOptions . ignored ) {
243
+ bundlerConfig . watchOptions . ignored = [
244
+ bundlerConfig . watchOptions . ignored as string ,
245
+ ] ;
246
+ } else {
247
+ bundlerConfig . watchOptions . ignored = [ ] ;
248
+ }
245
249
}
246
- }
247
- if ( mfConfig . dts !== false ) {
248
- if (
249
- typeof mfConfig . dts === 'object' &&
250
- typeof mfConfig . dts . consumeTypes === 'object' &&
251
- mfConfig . dts . consumeTypes . remoteTypesFolder
252
- ) {
253
- bundlerConfig . watchOptions . ignored . push (
254
- mfConfig . dts . consumeTypes . remoteTypesFolder ,
255
- ) ;
250
+ if ( mfConfig . dts !== false ) {
251
+ if (
252
+ typeof mfConfig . dts === 'object' &&
253
+ typeof mfConfig . dts . consumeTypes === 'object' &&
254
+ mfConfig . dts . consumeTypes . remoteTypesFolder
255
+ ) {
256
+ bundlerConfig . watchOptions . ignored . push (
257
+ `**/${ mfConfig . dts . consumeTypes . remoteTypesFolder } /**` ,
258
+ ) ;
259
+ } else {
260
+ bundlerConfig . watchOptions . ignored . push ( '**/@mf-types/**' ) ;
261
+ }
256
262
} else {
257
- bundlerConfig . watchOptions . ignored . push ( '@mf-types' ) ;
263
+ bundlerConfig . watchOptions . ignored . push ( '**/ @mf-types/** ' ) ;
258
264
}
259
265
}
260
-
261
266
if ( bundlerConfig . output ) {
262
267
if ( ! bundlerConfig . output ?. chunkLoadingGlobal ) {
263
268
bundlerConfig . output . chunkLoadingGlobal = `chunk_${ mfConfig . name } ` ;
0 commit comments