From d7fe27cb97048f1aa08755b1768785b824c77e9b Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Tue, 30 Jun 2026 20:59:57 +0100 Subject: [PATCH] Guard against falsy outputPath in eleventy htmlmin transform Eleventy passes a falsy outputPath to transforms for templates rendered without a written file (e.g. permalink: false); calling .endsWith on it would throw. Skip minification in that case instead. Pre-existing latent issue surfaced by Copilot review on #2091. --- site/.eleventy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/.eleventy.js b/site/.eleventy.js index 1f218a03..0f8d966f 100644 --- a/site/.eleventy.js +++ b/site/.eleventy.js @@ -87,7 +87,8 @@ module.exports = function (eleventyConfig) { // Minify HTML output eleventyConfig.addTransform('htmlmin', async function (content, outputPath) { - if (!outputPath.endsWith('.html')) { + // outputPath is falsy for templates rendered without a written file (e.g. permalink: false) + if (!outputPath || !outputPath.endsWith('.html')) { return content }