ibis/build.rs

21 lines
482 B
Rust
Raw Permalink Normal View History

use std::{
fs::{create_dir_all, File},
io::Result,
path::Path,
};
/// Create placeholders for wasm files so that `cargo check` etc work without explicitly building
/// frontend.
fn main() -> Result<()> {
create_dir_all("assets/dist/")?;
let js = "assets/dist/ibis.js";
if !Path::new(js).exists() {
File::create(js)?;
}
let wasm = "assets/dist/ibis_bg.wasm";
if !Path::new(wasm).exists() {
File::create(wasm)?;
}
Ok(())
}