diff options
author | Lukas Stabe <lukas@stabe.de> | 2020-09-26 21:07:24 +0000 |
---|---|---|
committer | Lukas Stabe <lukas@stabe.de> | 2020-09-26 21:07:24 +0000 |
commit | f8b74203b7457fbf0482ec9e10266b370b1bfeab (patch) | |
tree | fe938c009d892bf31853a50eb9f190b80276e4f3 /build.rs | |
parent | remove stylelint again and fix a few css issues (diff) | |
download | miniserve-f8b74203b7457fbf0482ec9e10266b370b1bfeab.tar.gz miniserve-f8b74203b7457fbf0482ec9e10266b370b1bfeab.zip |
compile scss at build time
Diffstat (limited to '')
-rw-r--r-- | build.rs | 13 |
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"); +} |