Skip to content

Commit

Permalink
fix incremental forget new entries
Browse files Browse the repository at this point in the history
  • Loading branch information
ahabhgk committed Jan 8, 2025
1 parent 81c1a2e commit 7969ce0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 11 additions & 0 deletions crates/rspack_core/src/build_chunk_graph/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// use rspack_core::Bundle;
// use rspack_core::ChunkGraph;

use incremental::ChunkReCreation;
use tracing::instrument;

use crate::{incremental::IncrementalPasses, Compilation};
Expand All @@ -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::<Vec<_>>();
for entry in more_entries {
entry.rebuild(&mut splitter, compilation)?;
}
}

splitter.split(compilation)?;
Expand Down
1 change: 0 additions & 1 deletion packages/rspack/src/Compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7969ce0

Please sign in to comment.