seveibar / make-vfs

Quickly generate a module file that represents a directory as a virtual file system
5 stars 1 forks source link

`with` directive? #4

Open benallfree opened 1 month ago

benallfree commented 1 month ago

From https://bun.sh/docs/bundler/executables#embed-assets-files

Does it need with { type: "file" } appended to the imports?

seveibar commented 1 month ago

@benallfree we could add that as an additional way to import. Sometimes people want to resolve the files with the default loader system vs an explicit "with" loader.

We could call it "with-file"? Open to a PR. Aider.chat could probably implement this one automatically!

seveibar commented 1 month ago

Actually maybe --content-format="import-with", i kind of like that.

benallfree commented 1 month ago

Great idea. I'll send a PR if I get further into needing it. It turns out that creating a stand-alone executable of node console apps is tricky because many node packages are not easy bundled. Anything that uses dynamic imports presents challenges.