Created
June 29, 2023 05:34
-
-
Save mcpar-land/b853da913ca7f45faa179704772961ef to your computer and use it in GitHub Desktop.
add tailwind to rust build script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::process::Command; | |
fn main() { | |
let tailwind_cmd = "npx tailwindcss -i input.css -o assets/app.css"; | |
if cfg!(target_os = "windows") { | |
Command::new("cmd").arg("/C").arg(tailwind_cmd).status() | |
} else { | |
Command::new("sh").arg("-c").arg(tailwind_cmd).status() | |
} | |
.expect("error running tailwind"); | |
println!("cargo:rerun-if-changed=tailwind.config.js"); | |
println!("cargo:rerun-if-changed=input.css"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
excellent!