@intlayer/chokidar
Version:
Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.
50 lines • 2.13 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var loadContentDeclaration_exports = {};
__export(loadContentDeclaration_exports, {
loadContentDeclarations: () => loadContentDeclarations
});
module.exports = __toCommonJS(loadContentDeclaration_exports);
var import_config = require("@intlayer/config");
var import_processContentDeclaration = require('../transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.cjs');
const loadContentDeclarations = async (contentDeclarationFilePath, projectRequire = import_config.ESMxCJSRequire) => {
const contentDeclarations = contentDeclarationFilePath.map((path) => ({
...(0, import_config.loadExternalFile)(path, void 0, projectRequire),
filePath: path
}));
const resultDictionariesPaths = [];
for await (const contentDeclaration of contentDeclarations) {
if (!contentDeclaration) {
continue;
}
const processedContentDeclaration = await (0, import_processContentDeclaration.processContentDeclaration)(
contentDeclaration
);
if (!processedContentDeclaration) {
continue;
}
resultDictionariesPaths.push(processedContentDeclaration);
}
return resultDictionariesPaths;
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
loadContentDeclarations
});
//# sourceMappingURL=loadContentDeclaration.cjs.map