Ask questionsStatic non-code resources in modules
Let's say I want to write a module that communicates with some service using Protobuf.
In Node.js, the npm package would contain .proto files which the module would load directly from the file system (using
What's the deno equivalent? It seems
import works only for code and
fetch wouldn't be cached.
Answer questions brandonkal
As far as I am aware, browsers do not handle arbitrary resources through import. I would like to see the ability to statically import YAML as a JS object but that isn't portable to browser runtimes.
Now I use a proxy and parse its default export text as YAML. That works fine for now because I can use Deno's existing import cache.
It would be the same for other resource types. If browsers support their static import, Deno should as well. Otherwise it should not diverge here.