Skip to content

Commit

Permalink
fix: splitChunks.enforce, pass more webpack-tests (#4353)
Browse files Browse the repository at this point in the history
fix: splitChunks.enforce should enforce minChunks to be 1
  • Loading branch information
JSerFeng authored and IWANABETHATGUY committed Oct 22, 2023
1 parent c9f7691 commit 5cc7c50
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 16 deletions.
8 changes: 5 additions & 3 deletions crates/rspack_binding_options/src/options/raw_split_chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,11 @@ impl From<RawSplitChunksOptions> 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
Expand Down
Original file line number Diff line number Diff line change
@@ -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'

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var HotModuleReplacementPlugin =
require("../../../../").HotModuleReplacementPlugin;
require("@rspack/core").HotModuleReplacementPlugin;
/** @type {import("@rspack/core").Configuration} */
module.exports = {
entry: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = () => {return false}
module.exports = () => 'block: require.main https://github.com/web-infra-dev/rspack/issues/3562'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var HotModuleReplacementPlugin =
require("../../../../").HotModuleReplacementPlugin;
require("@rspack/core").HotModuleReplacementPlugin;
/** @type {import("@rspack/core").Configuration} */
module.exports = {
entry: {
Expand Down
Original file line number Diff line number Diff line change
@@ -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'

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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'

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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'
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 5cc7c50

Please sign in to comment.