Tracking issue - WASM_BINDGEN snippets support changes
Author: guybedfordCreated Sep 4, 2026Updated Sep 4, 2026
This is a tracking issue from https://github.com/emscripten-core/emscripten/pull/27208#discussion_r3929655457.
wasm-bindgen outputs directly to a snippets folder for external inline code snippets, but does not optimize these into the single JS file itself. As a result this folder must be copied with the wasm-bindgen output files.
These are distinct from Emscripten-style inline code because they assume module syntax like an ES module file themselves - supporting import 'dep' and using their export interface as the snippet interface.
In future two possible optimizations could arise here:
- Emscripten doing the single-file JS optimization to inline these static known imports
- wasm-bindgen adding support for this optimization itself
In either of these cases, copying the snippets directory to support inline code would no longer be need which this tracks.
Source: emscripten-core/emscripten