Page MenuHomeSealhub

find-css-includes.ts
No OneTemporary

find-css-includes.ts

import { promises as fs } from "fs";
import _locreq from "locreq";
import { relative } from "path";
import { walkDir } from "./utils/walk";
const target_locreq = _locreq(process.cwd());
export async function generate_css_includes(): Promise<void> {
const files = await Promise.all(
(await walkDir(target_locreq.resolve("src/")))
.filter(
(f) =>
f.endsWith(".css") &&
!f.endsWith("/main.css") &&
!f.endsWith("\\main.css") &&
!f.endsWith("/includes.css") &&
!f.endsWith("\\includes.css") &&
!f.includes(".#")
)
.map((fullpath) =>
relative(target_locreq.resolve("src/"), fullpath)
)
);
await fs.writeFile(
target_locreq.resolve("src/includes.css"),
`/* DO NOT EDIT! This file is generated automaticaly with npx sealgen generate-css-includes */
@import "../node_modules/@sealcode/sealgen/src/forms/forms.css";
${files.map((path) => `@import "${path.replaceAll("\\", "/")}";`).join("\n")}
`
);
// eslint-disable-next-line no-console
console.log("Successfuly generated new src/includes.css file");
}

File Metadata

Mime Type
text/x-java
Expires
Thu, Jan 23, 19:19 (20 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
601504
Default Alt Text
find-css-includes.ts (1 KB)

Event Timeline