deno-embedder
deno-embedder copied to clipboard
Doc differences with `deno compile --include`
I should update the README w/ how this compares to the newly-added --include option in deno compile.
See: https://github.com/denoland/deno/pull/26939
And: https://github.com/denoland/deno/issues/20885
I want to do some testing to make sure I'm understand how it works before I document things, but as it stands, it looks like the new --include option has some weaknesses vs. deno-embedder:
-
Only works with
deno compilenotdeno run jsr:…? - Works by hijacking the
Deno.read*()functions to return embedded data instead of reading from the FS. (Doesn't this make reads ambiguous? Or isimport.meta.dirnamereturning something likeembedded://so it's unambiguous?) - Requires granting
--allow-read. (Avoiding that need is a big part of the purpose of deno-embedder. But I suppose this is moot since you're limited todeno compileanyway.)
Yep, according to the blog post for 2.1 https://deno.com/blog/v2.1#embed-assets-files-in-deno-compile
Keep in mind that you can only include local files. Remote files are not supported.