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
+6 -2
View File
@@ -22,11 +22,15 @@
use std::path::Path;
use bevy::log::warn;
use bevy::prelude::{App, Plugin, Resource, Startup};
use bevy::prelude::{App, Plugin, Resource};
#[cfg(not(target_arch = "wasm32"))]
use bevy::prelude::Startup;
use serde::Deserialize;
use super::ThemeMeta;
use crate::assets::{DARK_THEME_MANIFEST_URL, user_theme_dir};
use crate::assets::DARK_THEME_MANIFEST_URL;
#[cfg(not(target_arch = "wasm32"))]
use crate::assets::user_theme_dir;
/// One entry in the [`ThemeRegistry`] — the data the picker UI needs
/// to render a row and load the theme on selection.