fix(web): ship WGSL shaders to dist via trunk copy-dir

Bevy's HttpWasmAssetReader fetches asset paths over HTTP at runtime,
requesting 'assets/shaders/*.wgsl' (matching AssetPlugin's default
file_path of "assets"). Trunk only emits what index.html references,
so without an explicit copy-dir link the shaders were absent from dist/
and every material hit a 404 → grey screen.

Add the copy-dir link so trunk mirrors assets/ into dist/.
This commit is contained in:
xfy 2026-07-16 10:07:07 +08:00
parent 359d2f876f
commit 30786eb253

View File

@ -17,5 +17,11 @@
data-cargo-features="bevy/webgpu"
data-wasm-opt="z"
/>
<!-- Ship the WGSL shaders so Bevy's WasmAssetReader can fetch them at
runtime (it requests `assets/shaders/*.wgsl` over HTTP, matching the
default AssetPlugin file_path of "assets"). Without this the shaders
are absent from dist/ and every material loads a 404 fallback → grey
screen. -->
<link data-trunk rel="copy-dir" href="../assets" />
</body>
</html>