From 7432571b0d6afb07b7757c623735f8a232386ee7 Mon Sep 17 00:00:00 2001 From: Miguel Elizalde Date: Thu, 5 Feb 2026 15:00:34 -0700 Subject: [PATCH] fix: ensure output directory exists before writing component --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index a25ddbc..69db874 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -704,6 +704,10 @@ pub async fn componentize( ) })?; + // Checks if the output directory exists, and creates it if it doesn't. + if let Some(parent) = output_path.parent() { + fs::create_dir_all(parent)?; + } fs::write(output_path, component)?; Ok(())