@@ -576,6 +576,9 @@ const composeFormatConfig = ({
576576 importMeta : false ,
577577 importDynamic : false ,
578578 } ,
579+ others : {
580+ worker : false ,
581+ } ,
579582 } as const ;
580583
581584 switch ( format ) {
@@ -588,6 +591,7 @@ const composeFormatConfig = ({
588591 javascript : {
589592 ...jsParserOptions . esm ,
590593 ...jsParserOptions . cjs ,
594+ ...jsParserOptions . others ,
591595 } ,
592596 } ,
593597 } ,
@@ -618,7 +622,11 @@ const composeFormatConfig = ({
618622 rspack : {
619623 module : {
620624 parser : {
621- javascript : { ...jsParserOptions . esm , ...jsParserOptions . cjs } ,
625+ javascript : {
626+ ...jsParserOptions . esm ,
627+ ...jsParserOptions . cjs ,
628+ ...jsParserOptions . others ,
629+ } ,
622630 } ,
623631 } ,
624632 output : {
@@ -701,8 +709,8 @@ const composeFormatConfig = ({
701709 }
702710} ;
703711
704- const formatRsbuildPlugin = ( ) : RsbuildPlugin => ( {
705- name : 'rsbuild:format ' ,
712+ const disableUrlParseRsbuildPlugin = ( ) : RsbuildPlugin => ( {
713+ name : 'rsbuild:disable-url-parse ' ,
706714 setup ( api ) {
707715 api . modifyBundlerChain ( ( config , { CHAIN_ID } ) => {
708716 // Fix for https://github.com/web-infra-dev/rslib/issues/499.
@@ -761,7 +769,7 @@ const composeShimsConfig = (
761769 } ,
762770 plugins : [
763771 resolvedShims . esm . require && pluginEsmRequireShim ( ) ,
764- formatRsbuildPlugin ( ) ,
772+ disableUrlParseRsbuildPlugin ( ) ,
765773 ] . filter ( Boolean ) ,
766774 } ;
767775 break ;
@@ -770,6 +778,7 @@ const composeShimsConfig = (
770778 rsbuildConfig = {
771779 plugins : [
772780 resolvedShims . cjs [ 'import.meta.url' ] && pluginCjsImportMetaUrlShim ( ) ,
781+ disableUrlParseRsbuildPlugin ( ) ,
773782 ] . filter ( Boolean ) ,
774783 } ;
775784 break ;
0 commit comments