Closed lemmih closed 2 months ago
I think you would need to modify the JS shim that is used, import the assets in JavaScript and then supply them to the WebAssembly invocation.
Thanks.
I'm not sure what you are up to, but there are alternative ways to include the content of files inside the assembly, for instance:
include_str! for text files https://doc.rust-lang.org/std/macro.include_str.html
include_bytes! for binary files https://doc.rust-lang.org/std/macro.include_bytes.html
They end up being loaded as constants that you can reference.
Yeah, I used include_dir!
and wrote some wrapper code to serve those files.
Is there an existing issue for this?
Description
Is there a way to access the files bundled with a worker?
The documentation says the files can be accessed via
import
in JS, but I'm unsure how that translates to Rust.Documentation: https://developers.cloudflare.com/workers/wrangler/bundling/