Skip to content

Instantly share code, notes, and snippets.

@mcpar-land
Created June 29, 2023 05:34
Show Gist options
  • Save mcpar-land/b853da913ca7f45faa179704772961ef to your computer and use it in GitHub Desktop.
Save mcpar-land/b853da913ca7f45faa179704772961ef to your computer and use it in GitHub Desktop.
add tailwind to rust build script
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");
}
@mcpar-land
Copy link
Author

excellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment