cool-admin-vue/build/cool/module/index.ts

15 lines
259 B
TypeScript
Raw Normal View History

2023-09-28 13:50:15 +08:00
import fs from "fs";
export function createModule() {
let dirs: string[] = [];
try {
dirs = fs.readdirSync("./src/modules");
dirs = dirs.filter((e) => !e.includes("."));
} catch (err) {}
return `
export const dirs = ${JSON.stringify(dirs)}
`;
}