aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-10-01 10:22:44 +0200
committermetamuffin <metamuffin@disroot.org>2023-10-01 10:22:44 +0200
commit48afcd0d86b3b20da0fc8e289fecdda59eb290fe (patch)
tree4975a10842e6d7a5d6529d64cba1d9910e670001
parent3fa55dba1b0ca408a10e7456a6d4308dd114c2f6 (diff)
downloadjellything-48afcd0d86b3b20da0fc8e289fecdda59eb290fe.tar
jellything-48afcd0d86b3b20da0fc8e289fecdda59eb290fe.tar.bz2
jellything-48afcd0d86b3b20da0fc8e289fecdda59eb290fe.tar.zst
fix new bundler
-rw-r--r--server/build.rs9
-rw-r--r--server/src/routes/ui/style.rs12
2 files changed, 11 insertions, 10 deletions
diff --git a/server/build.rs b/server/build.rs
index 8b067a6..fb31a66 100644
--- a/server/build.rs
+++ b/server/build.rs
@@ -1,4 +1,5 @@
-use std::process::Command;
+#![feature(exit_status_error)]
+use std::process::{Command, Stdio};
fn main() {
println!("cargo:rerun-if-changed=build.rs");
@@ -8,7 +9,7 @@ fn main() {
{
println!("cargo:rerun-if-changed={}", file.to_str().unwrap());
}
- Command::new("esbuild")
+ let mut proc = Command::new("esbuild")
.arg("../web/script/main.ts")
.arg("--bundle")
.arg(format!(
@@ -19,6 +20,8 @@ fn main() {
.arg("--sourcemap")
.arg("--sourcemap")
.arg("--format=esm")
- .output()
+ .stderr(Stdio::piped())
+ .spawn()
.unwrap();
+ proc.wait().unwrap().exit_ok().unwrap();
}
diff --git a/server/src/routes/ui/style.rs b/server/src/routes/ui/style.rs
index 9a7fc48..171c3ce 100644
--- a/server/src/routes/ui/style.rs
+++ b/server/src/routes/ui/style.rs
@@ -14,13 +14,11 @@ macro_rules! concat_files {
[ $($files),* ]
.into_iter()
.map(|n| {
- read_to_string(
- PathBuf::from_str(file!()).unwrap()
- .parent().unwrap()
- .parent().unwrap()
- .parent().unwrap()
- .join(n),
- )
+ read_to_string({
+ let p = PathBuf::from_str(file!()).unwrap().parent().unwrap().join($base).join(n);
+ log::debug!("load {p:?}");
+ p
+ })
.unwrap()
})
.collect::<Vec<_>>()