diff --git a/crates/rspack_binding_options/src/options/raw_split_chunks.rs b/crates/rspack_binding_options/src/options/raw_split_chunks.rs index 29c9b09367f..596308e6534 100644 --- a/crates/rspack_binding_options/src/options/raw_split_chunks.rs +++ b/crates/rspack_binding_options/src/options/raw_split_chunks.rs @@ -234,9 +234,11 @@ impl From for new_split_chunks_plugin::PluginOptions { &overall_max_initial_size }); - let min_chunks = v - .min_chunks - .unwrap_or(if enforce { 1 } else { overall_min_chunks }); + let min_chunks = if enforce { + 1 + } else { + v.min_chunks.unwrap_or(overall_min_chunks) + }; let r#type = v .r#type diff --git a/webpack-test/configCases/split-chunks-common/correct-order/test.filter.js b/webpack-test/configCases/split-chunks-common/correct-order/test.filter.js index 5e567709eb6..69c5ed99c80 100644 --- a/webpack-test/configCases/split-chunks-common/correct-order/test.filter.js +++ b/webpack-test/configCases/split-chunks-common/correct-order/test.filter.js @@ -1 +1 @@ -module.exports = () => "https://github.com/web-infra-dev/rspack/issues/3562" +module.exports = () => 'block: https://github.com/web-infra-dev/rspack/issues/3562' diff --git a/webpack-test/configCases/split-chunks-common/extract-async-from-entry/test.filter.js b/webpack-test/configCases/split-chunks-common/extract-async-from-entry/test.filter.js deleted file mode 100644 index 868b3d66233..00000000000 --- a/webpack-test/configCases/split-chunks-common/extract-async-from-entry/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => true diff --git a/webpack-test/configCases/split-chunks-common/hot-multi/test.filter.js b/webpack-test/configCases/split-chunks-common/hot-multi/test.filter.js deleted file mode 100644 index 3be456dcd23..00000000000 --- a/webpack-test/configCases/split-chunks-common/hot-multi/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => {return false} \ No newline at end of file diff --git a/webpack-test/configCases/split-chunks-common/hot-multi/webpack.config.js b/webpack-test/configCases/split-chunks-common/hot-multi/webpack.config.js index 3204e5807f6..c577d694a6e 100644 --- a/webpack-test/configCases/split-chunks-common/hot-multi/webpack.config.js +++ b/webpack-test/configCases/split-chunks-common/hot-multi/webpack.config.js @@ -1,5 +1,5 @@ var HotModuleReplacementPlugin = - require("../../../../").HotModuleReplacementPlugin; + require("@rspack/core").HotModuleReplacementPlugin; /** @type {import("@rspack/core").Configuration} */ module.exports = { entry: { diff --git a/webpack-test/configCases/split-chunks-common/hot/test.filter.js b/webpack-test/configCases/split-chunks-common/hot/test.filter.js index 3be456dcd23..697181b2828 100644 --- a/webpack-test/configCases/split-chunks-common/hot/test.filter.js +++ b/webpack-test/configCases/split-chunks-common/hot/test.filter.js @@ -1 +1 @@ -module.exports = () => {return false} \ No newline at end of file +module.exports = () => 'block: require.main https://github.com/web-infra-dev/rspack/issues/3562' diff --git a/webpack-test/configCases/split-chunks-common/hot/webpack.config.js b/webpack-test/configCases/split-chunks-common/hot/webpack.config.js index eb5584d7171..74a10e2c895 100644 --- a/webpack-test/configCases/split-chunks-common/hot/webpack.config.js +++ b/webpack-test/configCases/split-chunks-common/hot/webpack.config.js @@ -1,5 +1,5 @@ var HotModuleReplacementPlugin = - require("../../../../").HotModuleReplacementPlugin; + require("@rspack/core").HotModuleReplacementPlugin; /** @type {import("@rspack/core").Configuration} */ module.exports = { entry: { diff --git a/webpack-test/configCases/split-chunks-common/inverted-order/test.filter.js b/webpack-test/configCases/split-chunks-common/inverted-order/test.filter.js index 5e567709eb6..697181b2828 100644 --- a/webpack-test/configCases/split-chunks-common/inverted-order/test.filter.js +++ b/webpack-test/configCases/split-chunks-common/inverted-order/test.filter.js @@ -1 +1 @@ -module.exports = () => "https://github.com/web-infra-dev/rspack/issues/3562" +module.exports = () => 'block: require.main https://github.com/web-infra-dev/rspack/issues/3562' diff --git a/webpack-test/configCases/split-chunks-common/issue-12128/test.filter.js b/webpack-test/configCases/split-chunks-common/issue-12128/test.filter.js deleted file mode 100644 index 868b3d66233..00000000000 --- a/webpack-test/configCases/split-chunks-common/issue-12128/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => true diff --git a/webpack-test/configCases/split-chunks-common/library/test.filter.js b/webpack-test/configCases/split-chunks-common/library/test.filter.js index 6c09efca579..27bdf1f8e7b 100644 --- a/webpack-test/configCases/split-chunks-common/library/test.filter.js +++ b/webpack-test/configCases/split-chunks-common/library/test.filter.js @@ -1 +1 @@ -module.exports = () => "https://github.com/web-infra-dev/rspack/issues/3564" +module.exports = () => 'block: require.ensure https://github.com/web-infra-dev/rspack/issues/4304' diff --git a/webpack-test/configCases/split-chunks-common/move-entry/test.filter.js b/webpack-test/configCases/split-chunks-common/move-entry/test.filter.js deleted file mode 100644 index 868b3d66233..00000000000 --- a/webpack-test/configCases/split-chunks-common/move-entry/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => true diff --git a/webpack-test/configCases/split-chunks-common/move-to-grandparent/test.filter.js b/webpack-test/configCases/split-chunks-common/move-to-grandparent/test.filter.js deleted file mode 100644 index 868b3d66233..00000000000 --- a/webpack-test/configCases/split-chunks-common/move-to-grandparent/test.filter.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = () => true diff --git a/webpack-test/configCases/split-chunks-common/simple/test.filter.js b/webpack-test/configCases/split-chunks-common/simple/test.filter.js index 5e567709eb6..697181b2828 100644 --- a/webpack-test/configCases/split-chunks-common/simple/test.filter.js +++ b/webpack-test/configCases/split-chunks-common/simple/test.filter.js @@ -1 +1 @@ -module.exports = () => "https://github.com/web-infra-dev/rspack/issues/3562" +module.exports = () => 'block: require.main https://github.com/web-infra-dev/rspack/issues/3562' diff --git a/webpack-test/configCases/split-chunks-common/target-node/test.filter.js b/webpack-test/configCases/split-chunks-common/target-node/test.filter.js index 827967f4a45..cf1fd686533 100644 --- a/webpack-test/configCases/split-chunks-common/target-node/test.filter.js +++ b/webpack-test/configCases/split-chunks-common/target-node/test.filter.js @@ -1 +1 @@ -module.exports = () => {return "`splitChunks.name` doesn't support passing function"} +module.exports = () => 'block: not support function type splitChunks.name https://github.com/web-infra-dev/rspack/issues/4333'