feat(node): stabilize detecting if CJS via "type": "commonjs" in a package.json (#26439)

This will respect `"type": "commonjs"` in a package.json to determine if
`.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to
be ESM it will be loaded as ESM though.
This commit is contained in:
David Sherret 2024-11-13 10:10:09 -05:00 committed by GitHub
parent 6a4c6d83ba
commit f091d1ad69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
119 changed files with 1244 additions and 616 deletions

View file

@ -263,7 +263,7 @@ impl ReplLanguageServer {
}
fn get_document_uri(&self) -> Uri {
uri_parse_unencoded(self.cwd_uri.join("$deno$repl.ts").unwrap().as_str())
uri_parse_unencoded(self.cwd_uri.join("$deno$repl.mts").unwrap().as_str())
.unwrap()
}
}