cargo-web
cargo-web copied to clipboard
Static library files
It would be cool if it was possible for libraries to provide static files, not only the final app crate.
Currently it's only possible to embed files into libraries with include_bytes!
/include_str!
, but this is not good if the file is large.
but this is not good if the file is large.
Why isn't it good?
I've had some problems with loading images when they are embedded like this (which requires using image crate, and causing browser to hang, not sure why), while loading images with browser native APIs is much lighter, makes the wasm file smaller, which is useful if I'm downloading the image in background
Ah, okay, so you're saying you want it to include the files in the directory, but keep them separate (i.e. not bundle them)?
I want the behavior of static
files, but for library crates.
So that the static folders of all the crates in the dependency tree get merged when deploying the app.