Reproduction:
cargo build --release -p jarvis-gui # before this commit
→ Tauri'\''s generate_context!() reads frontend/dist/client which is
whatever the user (or me) last built, possibly hours ago. Result:
new release exe ships with stale UI. Caught when /commands page
kept rendering the placeholder after the new code was committed
and the binary was rebuilt — because dist/ was generated before
the Svelte file was rewritten.
Fix: build.rs now invokes `npm run build` in frontend/ on every
relink, and emits cargo:rerun-if-changed for frontend/src and
package.json so cargo also reruns build.rs when Svelte/TS sources
change. `cargo tauri build` still works (it runs npm twice, which
is wasteful but harmless). If npm is not installed (unlikely but
possible on a Rust-only CI), prints a cargo warning and bundles
whatever dist is on disk.
`dist` stays in frontend/.gitignore — this just makes sure a local
working copy always has a fresh dist before Tauri picks it up.
|
||
|---|---|---|
| .. | ||
| capabilities | ||
| gen/schemas | ||
| src | ||
| build.rs | ||
| Cargo.toml | ||
| Makefile.toml | ||
| tauri.conf.json | ||