2024-03-20 12:29:55 +05:00
|
|
|
use ignore::Walk;
|
2024-03-15 01:26:18 +05:00
|
|
|
use npm_rs::*;
|
|
|
|
|
|
|
|
fn main() {
|
2024-03-20 12:29:55 +05:00
|
|
|
for entry in Walk::new(".")
|
|
|
|
.filter_map(Result::ok)
|
|
|
|
.filter(|e| !e.path().is_dir())
|
|
|
|
.filter(|e| e.file_name() != "package-lock.json")
|
|
|
|
{
|
|
|
|
println!("cargo:rerun-if-changed={}", entry.path().display());
|
|
|
|
}
|
2024-03-15 19:21:13 +05:00
|
|
|
|
2024-03-15 11:28:55 +05:00
|
|
|
NpmEnv::default()
|
2024-03-15 01:26:18 +05:00
|
|
|
.with_node_env(&NodeEnv::from_cargo_profile().unwrap_or_default())
|
|
|
|
.init_env()
|
|
|
|
.install(None)
|
|
|
|
.run("build")
|
2024-03-15 11:28:55 +05:00
|
|
|
.exec()
|
|
|
|
.unwrap();
|
2024-03-15 01:26:18 +05:00
|
|
|
}
|