summaryrefslogtreecommitdiff
path: root/cli/proc_state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/proc_state.rs')
-rw-r--r--cli/proc_state.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/cli/proc_state.rs b/cli/proc_state.rs
index bed42b9b4..ee9098c76 100644
--- a/cli/proc_state.rs
+++ b/cli/proc_state.rs
@@ -443,12 +443,7 @@ impl ProcState {
.add_package_reqs(npm_package_references)
.await?;
self.npm_resolver.cache_packages().await?;
-
- // add the builtin node modules to the graph data
- let node_std_graph = self
- .create_graph(vec![(compat::MODULE_ALL_URL.clone(), ModuleKind::Esm)])
- .await?;
- self.graph_data.write().add_graph(&node_std_graph, false);
+ self.prepare_node_std_graph().await?;
}
// type check if necessary
@@ -492,6 +487,15 @@ impl ProcState {
Ok(())
}
+ /// Add the builtin node modules to the graph data.
+ pub async fn prepare_node_std_graph(&self) -> Result<(), AnyError> {
+ let node_std_graph = self
+ .create_graph(vec![(compat::MODULE_ALL_URL.clone(), ModuleKind::Esm)])
+ .await?;
+ self.graph_data.write().add_graph(&node_std_graph, false);
+ Ok(())
+ }
+
fn handle_node_resolve_result(
&self,
result: Result<Option<ResolveResponse>, AnyError>,