Skip to content

Commit 62ecbab

Browse files
Panic instead of warn when esbuild not found (#136)
1 parent 705e3db commit 62ecbab

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

crates/hm-dsl-engine/build.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
)]
88

99
use std::env;
10-
use std::fs;
1110
use std::path::{Path, PathBuf};
1211
use std::process::Command;
1312

@@ -22,17 +21,10 @@ fn main() {
2221
let esbuild = find_esbuild(&manifest_dir);
2322

2423
let Some(esbuild) = esbuild else {
25-
eprintln!(
26-
"cargo:warning=esbuild not found; writing stub bundles. \
27-
Run `npm ci` in crates/hm-dsl-engine/harmont-ts/ for real bundles."
24+
panic!(
25+
"esbuild not found.\
26+
Install it or run `npm ci` in crates/hm-dsl-engine/harmont-ts/ for generating js bundles before building the crate."
2827
);
29-
fs::write(out_dir.join("harmont-index.mjs"), "// stub\nexport {};").unwrap();
30-
fs::write(
31-
out_dir.join("harmont-toolchains.mjs"),
32-
"// stub\nexport {};",
33-
)
34-
.unwrap();
35-
return;
3628
};
3729

3830
bundle(

0 commit comments

Comments
 (0)