From ddf27fc132208aa5aa2a53ca4d4e03f4c0cfdf03 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Wed, 4 Feb 2026 14:40:57 +0100 Subject: [PATCH] perf: skip htmlmin during watch rebuilds, disable minifyCSS/minifyJS htmlmin transform was consuming 84% of build time (321s out of 384s). Two changes: - Only run htmlmin during initial build (ELEVENTY_RUN_MODE === "build"), skip during watch-mode rebuilds for faster content updates - Set minifyCSS and minifyJS to false to avoid expensive CSS/JS parsing Also updates CLAUDE.md paths for indiekit-dev workspace move. Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 27 ++++++++++++++++----------- eleventy.config.js | 8 ++++---- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index b9456bb..dbad8bb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,17 +7,18 @@ This file provides guidance to Claude Code when working with the Indiekit Eleven This is an Eleventy theme designed for use with Indiekit, supporting IndieWeb post types (notes, articles, bookmarks, likes, replies, reposts, photos). It's used as a **Git submodule** in the `indiekit-cloudron` deployment repository. **Live Site:** https://rmendes.net -**Parent Repo:** `/home/rick/code/indiekit-cloudron` (Cloudron deployment) +**Parent Repo:** `/home/rick/code/indiekit-dev/indiekit-cloudron` (Cloudron deployment) ## Submodule Relationship ``` -indiekit-cloudron/ # Cloudron deployment repo -└── eleventy-site/ # THIS REPO as submodule - ├── _includes/ - ├── _data/ - ├── content -> /app/data/content # Symlink at runtime - └── ... +indiekit-dev/ # Workspace root +└── indiekit-cloudron/ # Cloudron deployment repo + └── eleventy-site/ # THIS REPO as submodule + ├── _includes/ + ├── _data/ + ├── content -> /app/data/content # Symlink at runtime + └── ... ``` ## CRITICAL: Submodule Sync Workflow @@ -32,7 +33,7 @@ indiekit-cloudron/ # Cloudron deployment repo ```bash # After pushing changes to this theme repo: -cd /home/rick/code/indiekit-cloudron +cd /home/rick/code/indiekit-dev/indiekit-cloudron git submodule update --remote eleventy-site git add eleventy-site git commit -m "chore: update eleventy-site submodule" @@ -144,10 +145,14 @@ The `post.njk` layout includes syndication content for Bridgy (Bluesky/Mastodon) 3. Test locally with `npm run dev` 4. **Commit, push, and update submodule in indiekit-cloudron** -## Related Repositories +## Workspace Context -- **indiekit-cloudron** (`/home/rick/code/indiekit-cloudron`) - Cloudron deployment, contains this as submodule -- **indiekit** (`/home/rick/code/indiekit`) - Indiekit core (upstream reference) +This repo is part of the Indiekit development workspace at `/home/rick/code/indiekit-dev/`. See the workspace CLAUDE.md for the full repository map. + +## Related Repositories (all under `/home/rick/code/indiekit-dev/`) + +- **indiekit-cloudron/** - Cloudron deployment, contains this as submodule at `eleventy-site/` +- **indiekit/** - Upstream Indiekit fork (Lerna monorepo) ## Anti-Patterns diff --git a/eleventy.config.js b/eleventy.config.js index bccd5c3..a3d752e 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -103,16 +103,16 @@ export default function (eleventyConfig) { }, }); - // HTML minification for production builds + // HTML minification — only during initial build, skip during watch rebuilds eleventyConfig.addTransform("htmlmin", async function (content, outputPath) { - if (outputPath && outputPath.endsWith(".html")) { + if (outputPath && outputPath.endsWith(".html") && process.env.ELEVENTY_RUN_MODE === "build") { return await minify(content, { collapseWhitespace: true, removeComments: true, html5: true, decodeEntities: true, - minifyCSS: true, - minifyJS: true, + minifyCSS: false, + minifyJS: false, }); } return content;