fix(npm): improved optional dependency support (#19135)

Note: If the package information has already been cached, then this
requires running with `--reload` or for the registry information to be
fetched some other way (ex. the cache busting).

Closes #15544

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
David Sherret 2023-05-17 17:38:50 -04:00 committed by GitHub
parent ad22336245
commit 41f618a1df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 300 additions and 61 deletions

View file

@ -37,6 +37,7 @@ use deno_core::ModuleLoader;
use deno_core::ModuleSpecifier;
use deno_core::ModuleType;
use deno_core::ResolutionKind;
use deno_npm::NpmSystemInfo;
use deno_runtime::deno_fs;
use deno_runtime::deno_node;
use deno_runtime::deno_node::analyze::NodeCodeTranslator;
@ -350,6 +351,7 @@ pub async fn run(
npm_registry_url,
npm_resolution.clone(),
node_modules_path,
NpmSystemInfo::default(),
);
let npm_resolver = Arc::new(CliNpmResolver::new(
fs.clone(),