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 <noreply@anthropic.com>
This commit is contained in:
Ricardo
2026-02-04 14:40:57 +01:00
parent 80e4ec8b2b
commit ddf27fc132
2 changed files with 20 additions and 15 deletions
+11 -6
View File
@@ -7,12 +7,13 @@ 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
indiekit-dev/ # Workspace root
└── indiekit-cloudron/ # Cloudron deployment repo
└── eleventy-site/ # THIS REPO as submodule
├── _includes/
├── _data/
@@ -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
+4 -4
View File
@@ -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;