Skip to content

Commit d90f7de

Browse files
authored
fix: disable split chunks for umd and iife output format (#1378)
1 parent 020f528 commit d90f7de

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

packages/core/src/config.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -763,10 +763,7 @@ const composeFormatConfig = ({
763763
},
764764
optimization: {
765765
nodeEnv: process.env.NODE_ENV,
766-
splitChunks: {
767-
// sync chunk of umd can not be loaded without mounting on scripts
768-
chunks: 'async',
769-
},
766+
splitChunks: false,
770767
},
771768
plugins,
772769
},
@@ -811,6 +808,7 @@ const composeFormatConfig = ({
811808
},
812809
optimization: {
813810
nodeEnv: process.env.NODE_ENV,
811+
splitChunks: false,
814812
},
815813
plugins,
816814
},

packages/core/tests/__snapshots__/config.test.ts.snap

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3066,9 +3066,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
30663066
},
30673067
optimization: {
30683068
minimize: true,
3069-
splitChunks: {
3070-
chunks: 'async'
3071-
},
3069+
splitChunks: false,
30723070
minimizer: [
30733071
/* config.optimization.minimizer('js') */
30743072
new SwcJsMinimizerRspackPlugin(
@@ -5118,9 +5116,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
51185116
},
51195117
"optimization": {
51205118
"nodeEnv": undefined,
5121-
"splitChunks": {
5122-
"chunks": "async",
5123-
},
5119+
"splitChunks": false,
51245120
},
51255121
"output": {
51265122
"asyncChunks": false,
@@ -5367,6 +5363,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
53675363
},
53685364
"optimization": {
53695365
"nodeEnv": undefined,
5366+
"splitChunks": false,
53705367
},
53715368
"output": {
53725369
"asyncChunks": false,

0 commit comments

Comments
 (0)