UNPKG

@intlayer/chokidar

Version:

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

17 lines 569 B
import { getConfiguration, normalizePath } from "@intlayer/config"; import fg from "fast-glob"; import { existsSync, mkdirSync } from "fs"; const getBuiltDictionariesPath = (configuration = getConfiguration()) => { const { dictionariesDir, mainDir } = configuration.content; if (!existsSync(mainDir)) { mkdirSync(mainDir, { recursive: true }); } const dictionariesPath = fg.sync( `${normalizePath(dictionariesDir)}/**/*.json` ); return dictionariesPath; }; export { getBuiltDictionariesPath }; //# sourceMappingURL=getBuiltDictionariesPath.mjs.map