From 0cf09621863967007b87ecf4bb5013e6b4ef45da Mon Sep 17 00:00:00 2001 From: lilsus Date: Thu, 16 Jul 2026 06:50:13 +0300 Subject: [PATCH] fix: pin Tailwind config path + absolute content globs (cwd-independent PostCSS for CI) --- postcss.config.js | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/postcss.config.js b/postcss.config.js index 02e05d1..eaf39df 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,11 +1,19 @@ -/** - * PostCSS configuration used by Hugo Pipes (css.PostCSS) AND the standalone - * `npm run build:css` step. Requires the `postcss-cli` devDependency so Hugo - * can shell out to the local `postcss` binary during the asset pipeline. - */ -module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -}; +/** + * PostCSS configuration used by Hugo Pipes (css.PostCSS) AND the standalone + * `npm run build:css` step. Requires the `postcss-cli` devDependency so Hugo + * can shell out to the local `postcss` binary during the asset pipeline. + * + * The Tailwind config path is pinned to this file's directory. Tailwind v3 + * otherwise resolves tailwind.config.js relative to process.cwd(); when Hugo's + * PostCSS pipeline runs with a cwd other than the project root (notably in CI), + * the config is not found, `content` is empty, and @apply'd utilities like + * `text-secondary` fail with "class does not exist". Pinning it fixes that. + */ +const path = require("path"); + +module.exports = { + plugins: { + tailwindcss: { config: path.join(__dirname, "tailwind.config.js") }, + autoprefixer: {}, + }, +};