fix(wasm): gate wasm32-only imports behind cfg, add binaryen wasm-opt pass
Build and Deploy / build-and-push (push) Failing after 1m12s

- Gate `Startup` and `user_theme_dir` imports in theme/registry.rs
  behind `#[cfg(not(target_arch = "wasm32"))]` — they are only used
  in the non-wasm code path, eliminating two unused-import warnings
  in the WASM release build.
- Rebuild canvas_bg.wasm and solitaire_wasm_bg.wasm with wasm-opt -Oz
  (binaryen v129); canvas_bg.wasm drops from 57 MB → 30 MB.
- Add solitaire_web/Cargo.toml stub to server Dockerfile so
  `cargo fetch --locked` resolves all workspace members.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-06-01 14:53:36 -07:00
parent c68cf96488
commit 0bae839e3b
4 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -21,11 +21,12 @@ COPY solitaire_server/Cargo.toml ./solitaire_server/Cargo.toml
COPY solitaire_app/Cargo.toml ./solitaire_app/Cargo.toml
COPY solitaire_assetgen/Cargo.toml ./solitaire_assetgen/Cargo.toml
COPY solitaire_wasm/Cargo.toml ./solitaire_wasm/Cargo.toml
COPY solitaire_web/Cargo.toml ./solitaire_web/Cargo.toml
# Stub every workspace crate so `cargo fetch --locked` resolves the full
# dependency graph without requiring source files beyond Cargo.toml.
RUN for crate in solitaire_core solitaire_sync solitaire_data solitaire_engine \
solitaire_server solitaire_app solitaire_assetgen solitaire_wasm; do \
solitaire_server solitaire_app solitaire_assetgen solitaire_wasm solitaire_web; do \
mkdir -p $crate/src && echo "pub fn _stub() {}" > $crate/src/lib.rs; \
done && \
echo "fn main() {}" > solitaire_server/src/main.rs && \
Binary file not shown.
Binary file not shown.