mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-05-15 06:58:50 +02:00
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:
@@ -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.
|
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
|
**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
|
## Submodule Relationship
|
||||||
|
|
||||||
```
|
```
|
||||||
indiekit-cloudron/ # Cloudron deployment repo
|
indiekit-dev/ # Workspace root
|
||||||
|
└── indiekit-cloudron/ # Cloudron deployment repo
|
||||||
└── eleventy-site/ # THIS REPO as submodule
|
└── eleventy-site/ # THIS REPO as submodule
|
||||||
├── _includes/
|
├── _includes/
|
||||||
├── _data/
|
├── _data/
|
||||||
@@ -32,7 +33,7 @@ indiekit-cloudron/ # Cloudron deployment repo
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# After pushing changes to this theme repo:
|
# 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 submodule update --remote eleventy-site
|
||||||
git add eleventy-site
|
git add eleventy-site
|
||||||
git commit -m "chore: update eleventy-site submodule"
|
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`
|
3. Test locally with `npm run dev`
|
||||||
4. **Commit, push, and update submodule in indiekit-cloudron**
|
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
|
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.
|
||||||
- **indiekit** (`/home/rick/code/indiekit`) - Indiekit core (upstream reference)
|
|
||||||
|
## 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
|
## Anti-Patterns
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -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) {
|
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, {
|
return await minify(content, {
|
||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
removeComments: true,
|
removeComments: true,
|
||||||
html5: true,
|
html5: true,
|
||||||
decodeEntities: true,
|
decodeEntities: true,
|
||||||
minifyCSS: true,
|
minifyCSS: false,
|
||||||
minifyJS: true,
|
minifyJS: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return content;
|
return content;
|
||||||
|
|||||||
Reference in New Issue
Block a user