denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.99k stars 5.23k forks source link

Support `import foo from "./bar.txt" with { as: "bytes" }` #25354

Open lucacasonato opened 1 week ago

lucacasonato commented 1 week ago

Would import the relevant file as a byte buffer (Uint8Array). Maybe also import foo from "./bar.txt" with { as: "text" }?

marvinhagemeister commented 1 week ago

The import as text could also be very useful for bundler plugins.

lucacasonato commented 1 week ago

Also see https://github.com/whatwg/html/issues/9444

littledivy commented 1 week ago

Would be super useful for deno compile apps (https://github.com/denoland/deno/issues/17994)