2026-06-16 13:16:35 +03:00
|
|
|
# Trunk config for the web (wasm) build of Open CAD Studio (issue #45).
|
|
|
|
|
#
|
|
|
|
|
# Build: trunk build --release
|
|
|
|
|
# Dev: trunk serve
|
|
|
|
|
#
|
|
|
|
|
# Requires: rustup target add wasm32-unknown-unknown
|
|
|
|
|
# cargo install trunk wasm-bindgen-cli
|
|
|
|
|
|
|
|
|
|
[build]
|
|
|
|
|
target = "index.html"
|
2026-06-16 17:53:56 +03:00
|
|
|
# Note: the `solid3d` feature is disabled via `data-cargo-no-default-features`
|
|
|
|
|
# on the rust <link> in index.html (truck-meshalgo → lzma-sys C deps cannot
|
|
|
|
|
# cross-compile to wasm).
|
2026-06-16 13:16:35 +03:00
|
|
|
|
2026-07-25 18:49:18 +03:00
|
|
|
[[hooks]]
|
2026-07-25 21:34:29 +03:00
|
|
|
stage = "post_build"
|
2026-07-25 18:49:18 +03:00
|
|
|
command = "sh"
|
|
|
|
|
command_arguments = ["scripts/build-web-worker.sh"]
|
|
|
|
|
|
2026-06-16 13:16:35 +03:00
|
|
|
[serve]
|
|
|
|
|
# Cross-origin isolation headers enable SharedArrayBuffer, which wasm threads
|
|
|
|
|
# (rayon) need. GitHub Pages cannot set these; a self-hosted server (e.g. the
|
|
|
|
|
# Open-AEC host) can. Without them the app still runs single-threaded.
|
|
|
|
|
headers = { "Cross-Origin-Opener-Policy" = "same-origin", "Cross-Origin-Embedder-Policy" = "require-corp" }
|