MrKleeblattM
Denoβ€’3y agoβ€’
4 replies
MrKleeblatt

`await import()` without global execution

Hello there.
This is some code from my
test.ts
:
// test.ts
console.log("Hello World");
export const say_hi = ()=>console.log("hi");

When I import
test.ts
via
// main.ts
const mod = await import("test.ts");

the code inside
test.ts
will be executed and I get
Hello World
to the console. Is it possible that I import only exported code from
test.ts
and do not run any of it intrinsically?
Was this page helpful?