From f8b74203b7457fbf0482ec9e10266b370b1bfeab Mon Sep 17 00:00:00 2001 From: Lukas Stabe Date: Sat, 26 Sep 2020 23:07:24 +0200 Subject: compile scss at build time --- build.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 build.rs (limited to 'build.rs') 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"); +} -- cgit v1.2.3