aboutsummaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
authorLukas Stabe <lukas@stabe.de>2020-09-26 21:07:24 +0000
committerLukas Stabe <lukas@stabe.de>2020-09-26 21:07:24 +0000
commitf8b74203b7457fbf0482ec9e10266b370b1bfeab (patch)
treefe938c009d892bf31853a50eb9f190b80276e4f3 /build.rs
parentremove stylelint again and fix a few css issues (diff)
downloadminiserve-f8b74203b7457fbf0482ec9e10266b370b1bfeab.tar.gz
miniserve-f8b74203b7457fbf0482ec9e10266b370b1bfeab.zip
compile scss at build time
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/build.rs b/build.rs
new file mode 100644
index 0000000..c759316
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,13 @@
+use std::env;
+use std::fs;
+use std::path::Path;
+
+fn main() {
+ let out_dir = env::var_os("OUT_DIR").unwrap();
+ let dest_path = Path::new(&out_dir).join("style.css");
+ fs::write(
+ &dest_path,
+ grass::from_string(include_str!("data/style.scss").to_string(), &grass::Options::default()).unwrap()
+ ).unwrap();
+ println!("cargo:rerun-if-changed=data/style.css");
+}