diff --git a/crates/rspack_core/src/build_chunk_graph/mod.rs b/crates/rspack_core/src/build_chunk_graph/mod.rs index ad4a2d236810..64a1e44470c2 100644 --- a/crates/rspack_core/src/build_chunk_graph/mod.rs +++ b/crates/rspack_core/src/build_chunk_graph/mod.rs @@ -1,6 +1,7 @@ // use rspack_core::Bundle; // use rspack_core::ChunkGraph; +use incremental::ChunkReCreation; use tracing::instrument; use crate::{incremental::IncrementalPasses, Compilation}; @@ -23,6 +24,16 @@ pub(crate) fn build_chunk_graph(compilation: &mut Compilation) -> rspack_error:: if !enable_incremental || splitter.chunk_group_infos.is_empty() { let inputs = splitter.prepare_input_entrypoints_and_modules(compilation)?; splitter.prepare_entries(inputs, compilation)?; + } else if compilation.entries.len() > compilation.entrypoints.len() { + let more_entries = compilation + .entries + .keys() + .filter(|entry| !compilation.entrypoints.contains_key(entry.as_str())) + .map(|entry| ChunkReCreation::Entry(entry.to_owned())) + .collect::>(); + for entry in more_entries { + entry.rebuild(&mut splitter, compilation)?; + } } splitter.split(compilation)?; diff --git a/packages/rspack/src/Compilation.ts b/packages/rspack/src/Compilation.ts index 97507e57cb43..21cde60a88af 100644 --- a/packages/rspack/src/Compilation.ts +++ b/packages/rspack/src/Compilation.ts @@ -1265,7 +1265,6 @@ class AddIncludeDispatcher { this.#args = []; const cbs = this.#cbs; this.#cbs = []; - console.log("args.length", args.length); this.#inner(args, (wholeErr, results) => { if (this.#args.length !== 0) { queueMicrotask(this.#execute);