@@ -241,29 +241,39 @@ export function patchBundlerConfig<T extends Bundler>(options: {
241
241
bundlerConfig . watchOptions = bundlerConfig . watchOptions || { } ;
242
242
if ( ! Array . isArray ( bundlerConfig . watchOptions . ignored ) ) {
243
243
if ( bundlerConfig . watchOptions . ignored ) {
244
- bundlerConfig . watchOptions . ignored = [
245
- bundlerConfig . watchOptions . ignored as string ,
246
- ] ;
244
+ if ( typeof bundlerConfig . watchOptions . ignored !== 'string' ) {
245
+ logger . warn (
246
+ `Detect you have set watchOptions.ignore as regexp, please transform it to glob string array and add "**/@mf-types/**" to the array.` ,
247
+ ) ;
248
+ } else {
249
+ bundlerConfig . watchOptions . ignored = [
250
+ bundlerConfig . watchOptions . ignored ,
251
+ ] ;
252
+ }
247
253
} else {
248
254
bundlerConfig . watchOptions . ignored = [ ] ;
249
255
}
250
256
}
251
- if ( mfConfig . dts !== false ) {
252
- if (
253
- typeof mfConfig . dts === 'object' &&
254
- typeof mfConfig . dts . consumeTypes === 'object' &&
255
- mfConfig . dts . consumeTypes . remoteTypesFolder
256
- ) {
257
- bundlerConfig . watchOptions . ignored . push (
258
- `**/${ mfConfig . dts . consumeTypes . remoteTypesFolder } /**` ,
259
- ) ;
257
+
258
+ if ( Array . isArray ( bundlerConfig . watchOptions . ignored ) ) {
259
+ if ( mfConfig . dts !== false ) {
260
+ if (
261
+ typeof mfConfig . dts === 'object' &&
262
+ typeof mfConfig . dts . consumeTypes === 'object' &&
263
+ mfConfig . dts . consumeTypes . remoteTypesFolder
264
+ ) {
265
+ bundlerConfig . watchOptions . ignored . push (
266
+ `**/${ mfConfig . dts . consumeTypes . remoteTypesFolder } /**` ,
267
+ ) ;
268
+ } else {
269
+ bundlerConfig . watchOptions . ignored . push ( '**/@mf-types/**' ) ;
270
+ }
260
271
} else {
261
272
bundlerConfig . watchOptions . ignored . push ( '**/@mf-types/**' ) ;
262
273
}
263
- } else {
264
- bundlerConfig . watchOptions . ignored . push ( '**/@mf-types/**' ) ;
265
274
}
266
275
}
276
+
267
277
if ( bundlerConfig . output ) {
268
278
if ( ! bundlerConfig . output ?. chunkLoadingGlobal ) {
269
279
bundlerConfig . output . chunkLoadingGlobal = `chunk_${ mfConfig . name } ` ;
0 commit comments