Skip to content

web search done right

Optimize frontend build time (#39)

Oliver Bøvingf972b163c597
diff --git a/build.rs b/build.rs
index b0b30318..ca5c2836 100644
--- a/build.rs
+++ b/build.rs
@@ -1,17 +1,3 @@
-use std::process::Command;
-
fn main() {
- Command::new("npm")
- .current_dir("frontend")
- .arg("install")
- .status()
- .unwrap();
-
- Command::new("npm")
- .current_dir("frontend")
- .args(&["run", "build"])
- .status()
- .unwrap();
-
lalrpop::process_root().unwrap();
}
diff --git a/justfile b/justfile
index 61a101e6..ce18a18d 100644
--- a/justfile
+++ b/justfile
@@ -16,8 +16,16 @@
rm -rf data/webgraph
cargo run --release -- webgraph local configs/webgraph/local.toml
+@frontend-rerun:
+ # To inspect timings use the commands below instead:
+ # time ((cd frontend; npm run build) && cargo build)
+ # cargo run -- frontend data/index data/queries_us.csv data/entity data/bangs.json
+ cd frontend; npm run build
+ cargo run -- frontend data/index data/queries_us.csv data/entity data/bangs.json
+
@frontend:
- cargo watch -x 'run -- frontend data/index data/queries_us.csv data/entity data/bangs.json'
+ cd frontend; npm install
+ cargo watch -s 'just frontend-rerun'
@astro:
cd frontend; npm run dev