From 6dc7bc0a8d0de8d71becc82f99600028d6105f71 Mon Sep 17 00:00:00 2001 From: cswimr Date: Sun, 29 Dec 2024 17:56:40 -0500 Subject: [PATCH] build(tailwindcss): only include classes.json in the built plugin files - output.css is not used --- package.json | 2 +- src/tailwindcss/generator/index.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 15f07e0..2783bc8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "yarn generate && gauntlet build", "dev": "gauntlet dev", "format": "eslint --fix .", - "generate": "node ./generate.js" + "generate": "node ./generate.js && rm -rf ./assets/**/tmp" }, "dependencies": { "@project-gauntlet/api": "0.12.0", diff --git a/src/tailwindcss/generator/index.js b/src/tailwindcss/generator/index.js index c7aa9ae..ed533ca 100644 --- a/src/tailwindcss/generator/index.js +++ b/src/tailwindcss/generator/index.js @@ -4,20 +4,22 @@ import path from "path"; import { fileURLToPath } from "url"; import { execSync } from "child_process"; +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + try { execSync( - "yarn dlx tailwindcss -i ./src/tailwindcss/generator/input.css -o ./assets/tailwindcss/generated/output.css", - { stdio: "inherit" } + "yarn dlx tailwindcss -c ../../../tailwind.config.js -i ./input.css -o ../../../assets/tailwindcss/tmp/output.css", + { + cwd: __dirname, + } ); } catch (error) { console.error("Error running tailwindcss: ", error); } -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - const file = fs.readFileSync( - path.join(__dirname, "../../../assets/tailwindcss/generated/output.css"), + path.join(__dirname, "../../../assets/tailwindcss/tmp/output.css"), "utf8" );