Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo web doesn't serve or deploy Emscripten .data files #254

Open
KeyboardDanni opened this issue Jun 8, 2021 · 0 comments
Open

cargo web doesn't serve or deploy Emscripten .data files #254

KeyboardDanni opened this issue Jun 8, 2021 · 0 comments

Comments

@KeyboardDanni
Copy link

When using --preload-file in the Emscripten target linker arguments, the toolchain will generate a file called crate-name.data containing the specified files to serve alongside the .js and .wasm files. However, cargo web doesn't seem to be aware of this as it only copies the .js and .wasm to the output directory, and the .data file is effectively missing when using cargo web start or cargo web deploy. The .data file is left within deps/ and while you can copy it into static/ as a workaround, it is easy to end up with a stale version of this file, which can cause problems if the generated .js file is newer than the .data file (since the .js file contains the offsets into the .data file for each virtual file).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant