1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-26 16:09:27 -05:00
denoland-deno/cli/tests/single_compile_with_reload.ts
Nayeem Rahman 2ea41d3ac1
fix(core/modules): Prepare modules only once per runtime (#11015)
This commit changes module loading implementation in "deno_core"
to call "ModuleLoader::prepare" hook only once per entry point.

This is done to avoid multiple type checking of the same code
in case of duplicated dynamic imports.

Relevant code in "cli/module_graph.rs" was updated as well.
2021-06-19 16:14:43 +02:00

18 lines
496 B
TypeScript

await import("./single_compile_with_reload_dyn.ts");
console.log("1");
await import("./single_compile_with_reload_dyn.ts");
console.log("2");
await new Promise((r) =>
new Worker(
new URL("single_compile_with_reload_worker.ts", import.meta.url).href,
{ type: "module" },
).onmessage = r
);
console.log("3");
await new Promise((r) =>
new Worker(
new URL("single_compile_with_reload_worker.ts", import.meta.url).href,
{ type: "module" },
).onmessage = r
);
console.log("4");