Skip to content

Commit

Permalink
fix(compat): use mjs extension for stream/promises (denoland#15341)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jul 29, 2022
1 parent 088bc52 commit b676cab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli/compat/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b676cab

Please sign in to comment.