Right now you can't do this:
const blob = new Blob("console.log(42)", { type: "text/javascript" });
const blobURL = URL.createObjectURL(blob);
await import(blobURL);
nodejs/node#47573
To fix this, I think a solution might be:
- Use
--loader so that blob: URLs get handled
- Use the global preload code hook to monkey-patch the
URL.createObjectURL() API to do a BroadcastChannel message to let the --loader thread know that a new blob: URL was made
I am interested in adding code to make this work.