mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
fix: loading built-in Node modules embedded in the binary (#17777)
Fixes bug introduced in ed3a7ce2f7
that
caused errors when loading built-in Node modules, when using "deno_graph".
This commit is contained in:
parent
b3c85c3548
commit
1d00bbe47e
5 changed files with 11 additions and 0 deletions
|
@ -534,6 +534,11 @@ impl ProcState {
|
|||
match maybe_resolved {
|
||||
Some((found_referrer, Resolution::Ok(resolved))) => {
|
||||
let specifier = &resolved.specifier;
|
||||
|
||||
if specifier.scheme() == "node" {
|
||||
return node::resolve_builtin_node_module(specifier.path());
|
||||
}
|
||||
|
||||
if let Ok(reference) = NpmPackageReference::from_specifier(specifier)
|
||||
{
|
||||
if !self.options.unstable()
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
import { createRequire } from "node:module";
|
||||
console.log(createRequire);
|
||||
import process from "node:process";
|
||||
console.log(process.version);
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
[Function: createRequire]
|
||||
v[WILDCARD].[WILDCARD].[WILDCARD]
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
import { createRequire } from "node:module";
|
||||
console.log(createRequire);
|
||||
import process from "node:process";
|
||||
console.log(process.version);
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
[Function: createRequire]
|
||||
v[WILDCARD].[WILDCARD].[WILDCARD]
|
||||
|
|
Loading…
Reference in a new issue