@@ -576,6 +576,9 @@ const composeFormatConfig = ({
576
576
importMeta : false ,
577
577
importDynamic : false ,
578
578
} ,
579
+ others : {
580
+ worker : false ,
581
+ } ,
579
582
} as const ;
580
583
581
584
switch ( format ) {
@@ -588,6 +591,7 @@ const composeFormatConfig = ({
588
591
javascript : {
589
592
...jsParserOptions . esm ,
590
593
...jsParserOptions . cjs ,
594
+ ...jsParserOptions . others ,
591
595
} ,
592
596
} ,
593
597
} ,
@@ -618,7 +622,11 @@ const composeFormatConfig = ({
618
622
rspack : {
619
623
module : {
620
624
parser : {
621
- javascript : { ...jsParserOptions . esm , ...jsParserOptions . cjs } ,
625
+ javascript : {
626
+ ...jsParserOptions . esm ,
627
+ ...jsParserOptions . cjs ,
628
+ ...jsParserOptions . others ,
629
+ } ,
622
630
} ,
623
631
} ,
624
632
output : {
@@ -701,8 +709,8 @@ const composeFormatConfig = ({
701
709
}
702
710
} ;
703
711
704
- const formatRsbuildPlugin = ( ) : RsbuildPlugin => ( {
705
- name : 'rsbuild:format ' ,
712
+ const disableUrlParseRsbuildPlugin = ( ) : RsbuildPlugin => ( {
713
+ name : 'rsbuild:disable-url-parse ' ,
706
714
setup ( api ) {
707
715
api . modifyBundlerChain ( ( config , { CHAIN_ID } ) => {
708
716
// Fix for https://github.com/web-infra-dev/rslib/issues/499.
@@ -761,7 +769,7 @@ const composeShimsConfig = (
761
769
} ,
762
770
plugins : [
763
771
resolvedShims . esm . require && pluginEsmRequireShim ( ) ,
764
- formatRsbuildPlugin ( ) ,
772
+ disableUrlParseRsbuildPlugin ( ) ,
765
773
] . filter ( Boolean ) ,
766
774
} ;
767
775
break ;
@@ -770,6 +778,7 @@ const composeShimsConfig = (
770
778
rsbuildConfig = {
771
779
plugins : [
772
780
resolvedShims . cjs [ 'import.meta.url' ] && pluginCjsImportMetaUrlShim ( ) ,
781
+ disableUrlParseRsbuildPlugin ( ) ,
773
782
] . filter ( Boolean ) ,
774
783
} ;
775
784
break ;
0 commit comments