Skip to content

Interested in adding @node-loader/blob #14

@jcbhmr

Description

@jcbhmr

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:

  1. Use --loader so that blob: URLs get handled
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions