mirror of
https://github.com/LukeHagar/skeleton.git
synced 2025-12-11 04:21:29 +00:00
renamed generated components file
This commit is contained in:
@@ -2,12 +2,14 @@
|
|||||||
import { generateAllTWClasses, transpileCssToJs } from './compile-css-to-js.cjs';
|
import { generateAllTWClasses, transpileCssToJs } from './compile-css-to-js.cjs';
|
||||||
import { mkdir, writeFile, rename, unlink } from 'fs/promises';
|
import { mkdir, writeFile, rename, unlink } from 'fs/promises';
|
||||||
|
|
||||||
|
const ALL_COMPONENTS_FILE_NAME = 'all-components.cjs';
|
||||||
|
|
||||||
exec();
|
exec();
|
||||||
|
|
||||||
async function exec() {
|
async function exec() {
|
||||||
// Deletes the previously generated CSS-in-JS file. If we don't, our plugin will
|
// Deletes the previously generated CSS-in-JS file. If we don't, our plugin will
|
||||||
// add duplicate classes to our newly generated CSS-in-JS file.
|
// add duplicate classes to our newly generated CSS-in-JS file.
|
||||||
await unlink('src/lib/tailwind/generated/allComponents.cjs').catch(() => {
|
await unlink(`src/lib/tailwind/generated/${ALL_COMPONENTS_FILE_NAME}`).catch(() => {
|
||||||
// file doesn't exist, don't worry about it
|
// file doesn't exist, don't worry about it
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -25,7 +27,7 @@ async function exec() {
|
|||||||
const purgedJSS = await removeDuplicateClasses(generatedJSS);
|
const purgedJSS = await removeDuplicateClasses(generatedJSS);
|
||||||
|
|
||||||
// Creates the generated CSS-in-JS file
|
// Creates the generated CSS-in-JS file
|
||||||
await writeFile('src/lib/tailwind/generated/allComponents.cjs', `module.exports = ${JSON.stringify(purgedJSS)}`).catch((e) =>
|
await writeFile(`src/lib/tailwind/generated/${ALL_COMPONENTS_FILE_NAME}`, `module.exports = ${JSON.stringify(purgedJSS)}`).catch((e) =>
|
||||||
console.error(e)
|
console.error(e)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user