Open
Description
If you have serialized "content" of a specific loader format (say for example TypeScript, or whatever), it would be nice to be able to use the existing loader functionality to be able to evaluate it "inline". One might for example expect that vm.Script
, given that it allows you specify a filename
option, might automatically choose the right loader:
// Imagine this was run with --experimental-loader typescript-loader.mjs
vm.Script("const x: Number = 5;", { filename: "test.ts" });
As far as I'm aware though, there is no way to do this currently (please correct me if I am mistaken!). I tried seeing if I could call load() directly to go through the loading machinery and just passing in the source
property, but I also couldn't find an API to do that:
doLoad({ source: "some typescript...", url: "blah.ts" });
Metadata
Metadata
Assignees
Labels
No labels