UNPKG

@intlayer/chokidar

Version:

Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.

18 lines 682 B
import { getConfiguration, normalizePath } from "@intlayer/config"; import fg from "fast-glob"; import { existsSync, mkdirSync } from "fs"; const getBuiltDynamicDictionariesPath = (configuration = getConfiguration(), format = "esm") => { const { dynamicDictionariesDir, mainDir } = configuration.content; if (!existsSync(mainDir)) { mkdirSync(mainDir, { recursive: true }); } const extension = format === "cjs" ? "cjs" : "mjs"; const dictionariesPath = fg.sync( `${normalizePath(dynamicDictionariesDir)}/**/*.${extension}` ); return dictionariesPath; }; export { getBuiltDynamicDictionariesPath }; //# sourceMappingURL=getBuiltDynamicDictionariesPath.mjs.map