deno-embedder icon indicating copy to clipboard operation
deno-embedder copied to clipboard

Doc differences with `deno compile --include`

Open NfNitLoop opened this issue 1 year ago • 1 comments

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 compile not deno 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 is import.meta.dirname returning something like embedded:// 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 to deno compile anyway.)

NfNitLoop avatar Nov 20 '24 19:11 NfNitLoop

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.

NfNitLoop avatar Nov 21 '24 21:11 NfNitLoop