build(tailwindcss): generate class.json and output.css on build instead of storing them in git
All checks were successful
Actions / Build Plugins (pull_request) Successful in 1m19s

This commit is contained in:
cswimr 2024-12-29 17:13:53 -05:00
parent b45c9182fd
commit 6b73a82819
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
5 changed files with 14 additions and 619516 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ node_modules
.idea
.yarn/*
!.yarn/releases
assets/**/generated

View file

@ -4,12 +4,13 @@
"license": "MIT",
"scripts": {
"publish": "gauntlet publish",
"build": "gauntlet build",
"build": "yarn generate && gauntlet build",
"dev": "gauntlet dev",
"format": "eslint --fix .",
"generate:css": "yarn dlx tailwindcss -i ./src/tailwindcss/generator/input.css -o ./src/tailwindcss/generator/output.css",
"generate:classes": "node ./src/tailwindcss/generator/index.js",
"generate": "yarn run generate:css && yarn run generate:classes"
"generate": "yarn run generate:tailwindcss",
"generate:tailwindcss:css": "yarn dlx tailwindcss -i ./src/tailwindcss/generator/input.css -o ./assets/tailwindcss/generated/output.css",
"generate:tailwindcss:classes": "node ./src/tailwindcss/generator/index.js",
"generate:tailwindcss": "yarn run generate:tailwindcss:css && yarn run generate:tailwindcss:classes"
},
"dependencies": {
"@project-gauntlet/api": "0.12.0",

File diff suppressed because one or more lines are too long

View file

@ -6,7 +6,10 @@ import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const file = fs.readFileSync(path.join(__dirname, "./output.css"), "utf8");
const file = fs.readFileSync(
path.join(__dirname, "../../../assets/tailwindcss/generated/output.css"),
"utf8"
);
const json = css
.parse(file)
@ -29,4 +32,7 @@ const json = css
};
});
fs.writeFileSync(path.join(__dirname, "./classes.json"), JSON.stringify(json));
fs.writeFileSync(
path.join(__dirname, "../../../assets/tailwindcss/generated/classes.json"),
JSON.stringify(json)
);

File diff suppressed because it is too large Load diff