Skip to content

Commit

Permalink
ifx
Browse files Browse the repository at this point in the history
  • Loading branch information
CPunisher committed Dec 5, 2024
1 parent fcc3967 commit d973cf8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
18 changes: 12 additions & 6 deletions crates/rspack_core/src/compiler/module_executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use self::{
overwrite::OverwriteTask,
};
use super::make::cutout::Cutout;
use super::make::repair::repair;
use super::make::{repair::MakeTaskContext, MakeArtifact, MakeParam};
use crate::cache::new_cache;
use crate::incremental::Mutation;
Expand Down Expand Up @@ -74,17 +75,22 @@ impl ModuleExecutor {
make_artifact.diagnostics = Default::default();
make_artifact.has_module_graph_change = false;

let build_dependencies = self
.cutout
.cutout_artifact(&mut make_artifact, params)
.into_iter()
.map(|(id, _)| id)
// Modules imported by `importModule` are passively loaded.
let mut build_dependencies = self.cutout.cutout_artifact(&mut make_artifact, params);
let mut build_dependencies_id = build_dependencies
.iter()
.map(|(id, _)| *id)
.collect::<HashSet<_>>();
for mut dep_status in self.request_dep_map.iter_mut() {
if build_dependencies.contains(&dep_status.id) {
if build_dependencies_id.contains(&dep_status.id) {
dep_status.should_update = true;
build_dependencies_id.remove(&dep_status.id);
}
}
build_dependencies.retain(|dep| build_dependencies_id.contains(&dep.0));
make_artifact = repair(compilation, make_artifact, build_dependencies)
.await
.unwrap_or_default();

let mut ctx = MakeTaskContext::new(
compilation,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Case import-module-2: Step 1

## Changed Files

- import_module_sub.js

## Asset Files
- Bundle: bundle.js
- Manifest: main.LAST_HASH.hot-update.json, size: 28
- Update: main.LAST_HASH.hot-update.js, size: 265
- Update: main.LAST_HASH.hot-update.js, size: 257

## Manifest

Expand All @@ -32,7 +32,7 @@
```js
self["webpackHotUpdate"]('main', {
"./loader.js!./a.js": (function (module) {
module.exports = undefined;
module.exports = 3;

}),

Expand Down

0 comments on commit d973cf8

Please sign in to comment.