From b7046f2bd88a11a1eee201d52d21ab1247137b8a Mon Sep 17 00:00:00 2001 From: Paul Keen <125715+pftg@users.noreply.github.com> Date: Mon, 11 May 2026 08:24:58 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"feat(perf):=20Beasties=20critical=20C?= =?UTF-8?q?SS=20=E2=80=94=20homepage-only=20(#335)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 56cdc723f47a8be5ce502278f64f0aa0d6109174. --- bin/hugo-build | 5 -- bin/inline-critical | 15 ------ bin/inline-critical.mjs | 106 ---------------------------------------- bun.lockb | Bin 181986 -> 178997 bytes package.json | 1 - 5 files changed, 127 deletions(-) delete mode 100755 bin/inline-critical delete mode 100644 bin/inline-critical.mjs diff --git a/bin/hugo-build b/bin/hugo-build index 4fe1dbad1..c7ba1387c 100755 --- a/bin/hugo-build +++ b/bin/hugo-build @@ -28,9 +28,4 @@ HUGO_ARGS=(hugo build --noBuildLock --environment "$ENVIRONMENT" --destination " "${HUGO_ARGS[@]}" -# Inline critical CSS in production builds -if [ "$ENVIRONMENT" = "production" ]; then - "$SCRIPT_DIR/inline-critical" "$OUTPUT_DIR" -fi - echo "✓ Build complete" diff --git a/bin/inline-critical b/bin/inline-critical deleted file mode 100755 index 6cbe57148..000000000 --- a/bin/inline-critical +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# Inline critical CSS using Beasties - -set -euo pipefail - -PUBLIC_DIR="${1:-_dest/public-dev}" - -if [ ! -d "$PUBLIC_DIR" ]; then - echo "Error: $PUBLIC_DIR does not exist" >&2 - exit 1 -fi - -echo "Inlining critical CSS in $PUBLIC_DIR..." -bun run "$(dirname "$0")/inline-critical.mjs" "$PUBLIC_DIR" -echo "✓ Critical CSS inlining complete" diff --git a/bin/inline-critical.mjs b/bin/inline-critical.mjs deleted file mode 100644 index 11a7a861a..000000000 --- a/bin/inline-critical.mjs +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env node -/** - * Critical CSS inlining via Beasties - * Process Hugo's public/ output to extract and inline above-the-fold critical CSS - */ - -import Beasties from 'beasties'; -import fs from 'node:fs'; -import path from 'node:path'; - -const target = process.argv[2]; - -if (!target) { - console.error('usage: inline-critical.mjs '); - process.exit(1); -} - -if (!fs.existsSync(target)) { - console.error(`Error: directory not found: ${target}`); - process.exit(1); -} - -const beasties = new Beasties({ - path: target, - publicPath: '/', - external: true, // process external stylesheets - remote: false, // don't download remote; we convert URLs to relative - pruneSource: false, // DO NOT modify source CSS files - reduceInlineStyles: true, - mergeStylesheets: false, // keep the deferred bundle separate - preload: 'swap', // - noscriptFallback: true, // add