diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-04-15 18:58:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-15 18:58:04 -0400 |
commit | 46c709e52f712ef7e1e41285ec06e9bbbe10c0a5 (patch) | |
tree | 470d7035ec71ba3acfb7b48f91771a1938c8e6fb /cli/npm/managed/mod.rs | |
parent | b4257d699086de0833df1541fb6f3af85d3054b2 (diff) |
fix(check): cache bust when changing nodeModulesDir setting (#23355)
Diffstat (limited to 'cli/npm/managed/mod.rs')
-rw-r--r-- | cli/npm/managed/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cli/npm/managed/mod.rs b/cli/npm/managed/mod.rs index 1479643e7..0625911d3 100644 --- a/cli/npm/managed/mod.rs +++ b/cli/npm/managed/mod.rs @@ -604,6 +604,9 @@ impl CliNpmResolver for ManagedCliNpmResolver { .collect::<Vec<_>>(); package_reqs.sort_by(|a, b| a.0.cmp(&b.0)); // determinism let mut hasher = FastInsecureHasher::new(); + // ensure the cache gets busted when turning nodeModulesDir on or off + // as this could cause changes in resolution + hasher.write_hashable(self.fs_resolver.node_modules_path().is_some()); for (pkg_req, pkg_nv) in package_reqs { hasher.write_hashable(&pkg_req); hasher.write_hashable(&pkg_nv); |