UNPKG

@intlayer/chokidar

Version:

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

26 lines 984 B
import { ESMxCJSRequire, loadExternalFile } from "@intlayer/config"; import { processContentDeclaration } from "../transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.mjs"; const loadContentDeclarations = async (contentDeclarationFilePath, projectRequire = ESMxCJSRequire) => { const contentDeclarations = contentDeclarationFilePath.map((path) => ({ ...loadExternalFile(path, void 0, projectRequire), filePath: path })); const resultDictionariesPaths = []; for await (const contentDeclaration of contentDeclarations) { if (!contentDeclaration) { continue; } const processedContentDeclaration = await processContentDeclaration( contentDeclaration ); if (!processedContentDeclaration) { continue; } resultDictionariesPaths.push(processedContentDeclaration); } return resultDictionariesPaths; }; export { loadContentDeclarations }; //# sourceMappingURL=loadContentDeclaration.mjs.map