fix(npm): ensure npm package downloaded once per run when using --reload (#16842)

This commit is contained in:
David Sherret 2022-11-27 13:25:08 -05:00 committed by GitHub
parent a4dfc6f955
commit fb04e87387
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 71 additions and 25 deletions

View file

@ -291,7 +291,9 @@ async fn sync_resolution_with_fs(
get_package_folder_id_folder_name(&package.get_package_cache_folder_id());
let folder_path = deno_local_registry_dir.join(&folder_name);
let initialized_file = folder_path.join(".initialized");
if !cache.should_use_cache_for_npm_package(&package.id.name)
if !cache
.cache_setting()
.should_use_for_npm_package(&package.id.name)
|| !initialized_file.exists()
{
let cache = cache.clone();