mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -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> {
|
||||
if SUPPORTED_MODULES.contains(&specifier) {
|
||||
let ext = match specifier {
|
||||
"stream/promises" => "mjs",
|
||||
_ => "ts",
|
||||
};
|
||||
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())
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Reference in a new issue