Rust library to generate static websites
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(tailwind): Throw proper errors in the Rolldown Tailwind plugin (#74)

* fix(tailwind): Throw proper errors in the Rolldown Tailwind plugin

* chore: changeset

authored by

Erika and committed by
GitHub
1ce6701f 696f653a

+9 -17
+5
.sampo/changesets/doughty-iceseeker-vainamoinen.md
··· 1 + --- 2 + cargo/maudit: patch 3 + --- 4 + 5 + Fixes Tailwind errors from stalling the build infinitely instead of erroring out
+4 -17
crates/maudit/src/assets/tailwind.rs
··· 1 - use std::{path::PathBuf, process::Command, time::Instant}; 1 + use std::{io::Error, path::PathBuf, process::Command, time::Instant}; 2 2 3 3 use log::info; 4 4 use oxc_sourcemap::SourceMap; ··· 49 49 command.arg("--map"); 50 50 } 51 51 52 - let tailwind_output = command.output() 53 - .unwrap_or_else(|e| { 54 - // TODO: Return a proper error instead of panicking 55 - let args_str = if crate::is_dev() { 56 - format!("['--input', '{}', '--map']", args.id) 57 - } else { 58 - format!("['--input', '{}', '--minify']", args.id) 59 - }; 60 - panic!( 61 - "Failed to execute Tailwind CSS command, is it installed and is the path to its binary correct?\nCommand: '{}', Args: {}. Error: {}", 62 - &self.tailwind_path.display(), 63 - args_str, 64 - e 65 - ) 66 - }); 52 + let tailwind_output = command.output()?; 67 53 68 54 if !tailwind_output.status.success() { 69 55 let stderr = String::from_utf8_lossy(&tailwind_output.stderr); ··· 71 57 "Tailwind CSS process failed with status {}: {}", 72 58 tailwind_output.status, stderr 73 59 ); 74 - panic!("{}", error_message); 60 + 61 + return Err(Error::other(error_message).into()); 75 62 } 76 63 77 64 info!("Tailwind took {:?}", start_tailwind.elapsed());