Skip to content

Commit 7ff8f3e

Browse files
committed
Suppress missing-assets warning during cargo leptos build
cargo-leptos invokes the SSR `cargo build` before writing the bundled JS/CSS/WASM into `target/site/pkg/`, so the warning fired spuriously during `make build`. Detect `LEPTOS_OUTPUT_NAME` (set by cargo-leptos for all sub-builds) and skip the warning in that case — it still fires for a plain `cargo build` / `cargo install --path .` where it matters.
1 parent 2491736 commit 7ff8f3e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ fn main() {
1111

1212
let assets_present = js.exists() && css.exists() && wasm.exists();
1313
let ssr_enabled = std::env::var("CARGO_FEATURE_SSR").is_ok();
14+
let driven_by_cargo_leptos = std::env::var("LEPTOS_OUTPUT_NAME").is_ok();
1415

15-
if ssr_enabled && !assets_present {
16+
if ssr_enabled && !assets_present && !driven_by_cargo_leptos {
1617
println!(
1718
"cargo:warning=Leptos hydration assets missing in {}. \
1819
Run `cargo leptos build` (or `make server-build`) before \

0 commit comments

Comments
 (0)