-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
clirelated to cli/ dirrelated to cli/ dirsuggestionsuggestions for new features (yet to be agreed)suggestions for new features (yet to be agreed)
Description
Problem
I often find myself needing to load non-JavaScript non-TypeScript assets, and various problems arise:
- Local module (in git repo) has to use
fs
but remote module has to usefetch
. - The assets cannot be cached.
- The assets cannot be bundled.
Suggestion
Add some way to annotate assets using comments, and fetch
should support those assets. For example:
// @deno-asset './assets/foo.wasm'
// @deno-asset './assets/bar.png'
await fetch(new URL('./assets/foo.wasm', import.meta.url))
await fetch(new URL('./assets/bar.png', import.meta.url))
// --allow-net is not required since it reads from cache
Alternatives
There is asset reference proposal that is likely not going to get to stage 3 anytime soon.
import assertion proposal had reached stage 3.
Import types text
and bytes
are being discussed in whatwg/html#9444
b-fuze, matmen, rivy, ah-yu, konuch and 8 more
Metadata
Metadata
Assignees
Labels
clirelated to cli/ dirrelated to cli/ dirsuggestionsuggestions for new features (yet to be agreed)suggestions for new features (yet to be agreed)