datasquirel/dist/package-shared/shell/tailwindWatch.js
Benjamin Toby 7e8bb37c09 Updates
2025-07-05 14:59:30 +01:00

26 lines
1.2 KiB
JavaScript

import fs from "fs";
import { exec } from "child_process";
require("dotenv").config({ path: "./../.env" });
const sourceFile = process.argv.indexOf("--src") >= 0
? process.argv[process.argv.indexOf("--src") + 1]
: null;
const destinationFile = process.argv.indexOf("--dst") >= 0
? process.argv[process.argv.indexOf("--dst") + 1]
: null;
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
console.log("Running Tailwind CSS compiler ...");
fs.watch("./../", (curr, prev) => {
exec(`bunx tailwindcss -i ./tailwind/main.css -o ./styles/tailwind.css`, (error, stdout, stderr) => {
if (error) {
console.log("ERROR =>", error.message);
return;
}
console.log("Tailwind CSS Compilation \x1b[32msuccessful\x1b[0m!");
});
});