mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +00:00
refactor(ext/node): untangle dependencies between js files (#18284)
Moving some code around in `ext/node` is it's a bit better well defined and makes it possible for others to embed it. I expect to see no difference in startup perf with this change.
This commit is contained in:
parent
d78db7c091
commit
cd53ab5427
16 changed files with 385 additions and 395 deletions
|
@ -680,7 +680,9 @@ pub fn translate_cjs_to_esm(
|
|||
let mut handled_reexports: HashSet<String> = HashSet::default();
|
||||
|
||||
let mut source = vec![
|
||||
r#"const require = Deno[Deno.internal].require.Module.createRequire(import.meta.url);"#.to_string(),
|
||||
r#"import {createRequire as __internalCreateRequire} from "node:module";
|
||||
const require = __internalCreateRequire(import.meta.url);"#
|
||||
.to_string(),
|
||||
];
|
||||
|
||||
let analysis = perform_cjs_analysis(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue