1 2 3 4 5 6 7 8 9 10 11 12 13
const blob = new Blob( [ "enum A {\n A,\n B,\n C,\n }\n \n export function a() {\n throw new Error(`Hello ${A.C}`);\n }\n ", ], { type: "application/typescript", }, ); const url = URL.createObjectURL(blob); const { a } = await import(url); a();