From 1cdc4b89a728b50dac60ebd014088824c263f7b9 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Tue, 10 Mar 2026 16:19:59 +0100 Subject: [PATCH] fix: handle non-string outputPath in html-transformer override MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit outputPath can be `false` for pages without output. Optional chaining (?.) only guards null/undefined, not booleans — use typeof check instead. Confab-Link: http://localhost:8080/sessions/0b241cd6-aff2-4fec-853c-2b5a61e61946 --- eleventy.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eleventy.config.js b/eleventy.config.js index f2c19df..d78776f 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -342,7 +342,7 @@ export default function (eleventyConfig) { // overwrites via addTransform) with a pre-check that avoids the full PostHTML // parse/serialize cycle (~3ms/page) for image-free pages. eleventyConfig.addTransform("@11ty/eleventy/html-transformer", async function(content) { - if (this.outputPath?.endsWith(".html") && !content.includes(", , etc.) // we must still run the full pipeline even without images. const hasUrlCallbacks = eleventyConfig.htmlTransformer.getCallbacks("html", this).length > 0;