YrXtals/web/build.rs

18 lines
602 B
Rust

// drops empty dist/ placeholders, keeping the server bin standalone-compilable.
// real bytes populated by the scripts/web/build.sh wasm-pack stage.
fn main() {
let dist = std::path::Path::new("dist");
let _ = std::fs::create_dir_all(dist);
let path = dist.join("index.html");
if !path.exists() {
let _ = std::fs::write(&path, b"");
println!(
"cargo:warning=missing {}, wrote empty placeholder. run scripts/web/build.sh to produce the real bundle.",
path.display()
);
}
println!("cargo:rerun-if-changed={}", path.display());
}