@@ -445,13 +445,6 @@ const composeFormatConfig = (format: Format): RsbuildConfig => {
445445 return {
446446 tools : {
447447 rspack : {
448- output : {
449- module : true ,
450- chunkFormat : 'module' ,
451- library : {
452- type : 'modern-module' ,
453- } ,
454- } ,
455448 module : {
456449 parser : {
457450 javascript : jsParserOptions ,
@@ -461,6 +454,16 @@ const composeFormatConfig = (format: Format): RsbuildConfig => {
461454 concatenateModules : true ,
462455 sideEffects : 'flag' ,
463456 } ,
457+ output : {
458+ module : true ,
459+ chunkFormat : 'module' ,
460+ library : {
461+ type : 'modern-module' ,
462+ } ,
463+ chunkLoading : 'import' ,
464+ workerChunkLoading : 'import' ,
465+ wasmLoading : 'fetch' ,
466+ } ,
464467 experiments : {
465468 outputModule : true ,
466469 } ,
@@ -483,6 +486,9 @@ const composeFormatConfig = (format: Format): RsbuildConfig => {
483486 library : {
484487 type : 'commonjs' ,
485488 } ,
489+ chunkLoading : 'require' ,
490+ workerChunkLoading : 'async-node' ,
491+ wasmLoading : 'async-node' ,
486492 } ,
487493 } ,
488494 } ,
@@ -758,11 +764,6 @@ const composeTargetConfig = (
758764 tools : {
759765 rspack : {
760766 target : [ 'web' ] ,
761- output : {
762- chunkLoading : 'import' ,
763- workerChunkLoading : 'import' ,
764- wasmLoading : 'fetch' ,
765- } ,
766767 } ,
767768 } ,
768769 } ;
@@ -772,13 +773,8 @@ const composeTargetConfig = (
772773 rspack : {
773774 target : [ 'node' ] ,
774775 // "__dirname" and "__filename" shims will automatically be enabled when `output.module` is `true`,
775- // and leave them as-is in the rest of the cases.
776+ // and leave them as-is in the rest of the cases. Leave the comments here to explain the behavior.
776777 // { node: { __dirname: ..., __filename: ... } }
777- output : {
778- chunkLoading : 'require' ,
779- workerChunkLoading : 'async-node' ,
780- wasmLoading : 'async-node' ,
781- } ,
782778 } ,
783779 } ,
784780 output : {
0 commit comments