fix: pin Tailwind config path + absolute content globs (cwd-independent PostCSS for CI)
This commit is contained in:
+19
-11
@@ -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: {},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user