Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ahabhgk committed Aug 15, 2024
1 parent 537e5db commit 01caa0c
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 22 deletions.
44 changes: 24 additions & 20 deletions crates/rspack_core/src/chunk_graph/chunk_graph_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ impl ChunkGraph {
compilation: &Compilation,
runtime: Option<&RuntimeSpec>,
) -> u64 {
let mut visited_modules = IdentifierSet::default();
visited_modules.insert(module.identifier());
let mut hasher = FxHasher::default();
self
.get_module_graph_hash_without_connections(module, compilation, runtime)
Expand All @@ -208,21 +206,25 @@ impl ChunkGraph {
.get_outgoing_connections(&module.identifier())
.into_iter()
.collect::<Vec<_>>();
for connection in connections {
let module_identifier = connection.module_identifier();
if visited_modules.contains(module_identifier) {
continue;
if !connections.is_empty() {
let mut visited_modules = IdentifierSet::default();
visited_modules.insert(module.identifier());
for connection in connections {
let module_identifier = connection.module_identifier();
if visited_modules.contains(module_identifier) {
continue;
}
if connection.get_active_state(&mg, runtime).is_false() {
continue;
}
visited_modules.insert(*module_identifier);
let module = mg
.module_by_identifier(module_identifier)
.expect("should have module")
.as_ref();
module.get_exports_type(&mg, strict).hash(&mut hasher);
self.get_module_graph_hash_without_connections(module, compilation, runtime);
}
if connection.get_active_state(&mg, runtime).is_false() {
continue;
}
visited_modules.insert(*module_identifier);
let module = mg
.module_by_identifier(module_identifier)
.expect("should have module")
.as_ref();
module.get_exports_type(&mg, strict).hash(&mut hasher);
self.get_module_graph_hash_without_connections(module, compilation, runtime);
}
hasher.finish()
}
Expand All @@ -233,12 +235,14 @@ impl ChunkGraph {
compilation: &Compilation,
runtime: Option<&RuntimeSpec>,
) -> u64 {
let mg = compilation.get_module_graph();
let mut hasher = FxHasher::default();
module.identifier().dyn_hash(&mut hasher);
let mg = compilation.get_module_graph();
let module_identifier = module.identifier();
let cgm = self.get_chunk_graph_module(module_identifier);
cgm.id.as_ref().dyn_hash(&mut hasher);
module.source_types().dyn_hash(&mut hasher);
mg.is_async(&module.identifier()).dyn_hash(&mut hasher);
mg.get_exports_info(&module.identifier())
mg.is_async(&module_identifier).dyn_hash(&mut hasher);
mg.get_exports_info(&module_identifier)
.update_hash(&mg, &mut hasher, compilation, runtime);
hasher.finish()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ __webpack_require__.e = function (chunkId) {
// return url for filenames not based on template

// return url for filenames based on template
return "" + chunkId + ".$" + "3c46e7c70e9c35a7c0c2" + "$.css";
return "" + chunkId + ".$" + "51f879692dc41105d447" + "$.css";
};

})();
// webpack/runtime/get_full_hash
(() => {
__webpack_require__.h = function () {
return "390adcbb2f3e066ff2d0";
return "5e241c5760a3e354e528";
};

})();
Expand Down

0 comments on commit 01caa0c

Please sign in to comment.