@@ -550,7 +550,6 @@ function esbuildScanPlugin(
550
550
// should be faster than doing it in the catch-all via js
551
551
// they are done after the bare import resolve because a package name
552
552
// may end with these extensions
553
-
554
553
const setupExternalize = (
555
554
filter : RegExp ,
556
555
doExternalize : ( path : string ) => boolean ,
@@ -561,16 +560,6 @@ function esbuildScanPlugin(
561
560
external : doExternalize ( path ) ,
562
561
}
563
562
} )
564
- // onResolve is not called for glob imports.
565
- // we need to add that here as well until esbuild calls onResolve for glob imports.
566
- // https://github.com/evanw/esbuild/issues/3317
567
- build . onLoad ( { filter, namespace : 'file' } , ( ) => {
568
- const externalOnLoadResult : OnLoadResult = {
569
- loader : 'js' ,
570
- contents : 'export default {}' ,
571
- }
572
- return externalOnLoadResult
573
- } )
574
563
}
575
564
576
565
// css
@@ -647,6 +636,16 @@ function esbuildScanPlugin(
647
636
contents,
648
637
}
649
638
} )
639
+
640
+ // onResolve is not called for glob imports.
641
+ // we need to add that here as well until esbuild calls onResolve for glob imports.
642
+ // https://github.com/evanw/esbuild/issues/3317
643
+ build . onLoad ( { filter : / .* / , namespace : 'file' } , ( ) => {
644
+ return {
645
+ loader : 'js' ,
646
+ contents : 'export default {}' ,
647
+ }
648
+ } )
650
649
} ,
651
650
}
652
651
}
0 commit comments