refactor(compile): store the npm snapshot in the eszip (#19343)

This commit is contained in:
David Sherret 2023-06-08 11:48:29 -04:00 committed by GitHub
parent 976c381045
commit 55f0150854
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 104 additions and 67 deletions

View file

@ -97,6 +97,7 @@ use crate::npm::create_npm_fs_resolver;
use crate::npm::CliNpmRegistryApi;
use crate::npm::CliNpmResolver;
use crate::npm::NpmCache;
use crate::npm::NpmCacheDir;
use crate::npm::NpmResolution;
use crate::tools::fmt::format_file;
use crate::tools::fmt::format_parsed_source;
@ -542,12 +543,13 @@ fn create_npm_api_and_cache(
progress_bar: &ProgressBar,
) -> (Arc<CliNpmRegistryApi>, Arc<NpmCache>) {
let npm_cache = Arc::new(NpmCache::new(
dir.npm_folder_path(),
NpmCacheDir::new(dir.npm_folder_path()),
// Use an "only" cache setting in order to make the
// user do an explicit "cache" command and prevent
// the cache from being filled with lots of packages while
// the user is typing.
CacheSetting::Only,
Arc::new(deno_fs::RealFs),
http_client.clone(),
progress_bar.clone(),
));