[Web] No way to prevent the default wasm from being bundled #24009
Labels
api:Javascript
issues related to the Javascript API
platform:web
issues related to ONNX Runtime web; typically submitted using template
stale
issues that have not been addressed in a while; categorized by a bot
Describe the issue
Hello 👋
Thank you for this great library,
We are facing an issue when specifying custom wasm paths:
Then as an application build process, we added a specific build step to output the custom wasm binary and corresponding mjs file into the destination directory.
When running
webpack
, the bundled output still contains the 10.5MB default wasm (first file in the picture below) shipped with onnxruntime-web and is still referenced in the bundled javascript (second picture).This increases the size of our extension artifact unnecessarily, that can be consequential and could come as a surprise.
Is there a way to properly exclude the default wasm from the bundle when providing a custom one ?
Thank you !
To reproduce
Reproduction sandbox - run
pnpm build
to generate a new folder in./dist
:https://codesandbox.io/p/devbox/s4mxt9
In the
dist
folder, you can see the generated WASM asset and the reference to it in themain.js
file.Urgency
We have a non-ideal workaround in place by not relying on
wasmPaths
and replacing the default wasm/mjs files directly in the library after building it following the official documentation. Solving this issue would allow us to get rid of this custom integration.ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.19.2
Execution Provider
'wasm'/'cpu' (WebAssembly CPU)
The text was updated successfully, but these errors were encountered: