mirror of
https://github.com/denoland/deno.git
synced 2025-01-18 03:44:05 -05:00
fix(compat): use mjs extension for stream/promises (#15341)
This commit is contained in:
parent
088bc52db0
commit
b676cab0b4
1 changed files with 5 additions and 1 deletions
|
@ -93,8 +93,12 @@ pub fn get_node_imports() -> Vec<(Url, Vec<String>)> {
|
||||||
|
|
||||||
fn try_resolve_builtin_module(specifier: &str) -> Option<Url> {
|
fn try_resolve_builtin_module(specifier: &str) -> Option<Url> {
|
||||||
if SUPPORTED_MODULES.contains(&specifier) {
|
if SUPPORTED_MODULES.contains(&specifier) {
|
||||||
|
let ext = match specifier {
|
||||||
|
"stream/promises" => "mjs",
|
||||||
|
_ => "ts",
|
||||||
|
};
|
||||||
let module_url =
|
let module_url =
|
||||||
format!("{}node/{}.ts", NODE_COMPAT_URL.as_str(), specifier);
|
format!("{}node/{}.{}", NODE_COMPAT_URL.as_str(), specifier, ext);
|
||||||
Some(Url::parse(&module_url).unwrap())
|
Some(Url::parse(&module_url).unwrap())
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
Loading…
Add table
Reference in a new issue