blob: 82556568eb649e3fc64bf0dcd54ba843dadb7179 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#![feature(exit_status_error)]
use std::process::{Command, Stdio};
fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=src/spectate/main.ts");
let outpath = std::env::var("OUT_DIR").unwrap();
// this is great :)))
println!("cargo:warning=\r\x1b[32m\x1b[1m Bundle\x1b[0m writing main.js ({outpath})");
let mut proc = Command::new("esbuild")
.arg("src/spectate/main.ts")
.arg("--bundle")
.arg(format!("--outfile={outpath}/main.js"))
.arg("--target=esnext")
.arg("--sourcemap")
.arg("--format=esm")
.stderr(Stdio::piped())
.spawn()
.unwrap();
proc.wait().unwrap().exit_ok().unwrap();
}
|