mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
refactor(npm): reorganize initialization of compat layer (#16471)
Ensures that "std/node" graph is analyzed only once.
This commit is contained in:
parent
e202f890f0
commit
2c674dcd20
3 changed files with 27 additions and 23 deletions
11
cli/main.rs
11
cli/main.rs
|
@ -292,17 +292,6 @@ async fn load_and_type_check(
|
|||
for file in files {
|
||||
let specifier = resolve_url_or_path(file)?;
|
||||
|
||||
// TODO(bartlomieju): in the future (after all relevant deno subcommands
|
||||
// have support for npm: specifiers), it would be good to unify this code
|
||||
// in `ProcState::prepare_module_load`.
|
||||
if let Ok(package_ref) = NpmPackageReference::from_specifier(&specifier) {
|
||||
ps.npm_resolver
|
||||
.add_package_reqs(vec![package_ref.req.clone()])
|
||||
.await?;
|
||||
ps.prepare_node_std_graph().await?;
|
||||
continue;
|
||||
}
|
||||
|
||||
ps.prepare_module_load(
|
||||
vec![specifier],
|
||||
false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue