@intlayer/chokidar
Version:
Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.
41 lines • 1.83 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 declaration_file_to_dictionary_exports = {};
__export(declaration_file_to_dictionary_exports, {
buildDictionary: () => buildDictionary
});
module.exports = __toCommonJS(declaration_file_to_dictionary_exports);
var import_config = require("@intlayer/config");
var import_i18next_dictionary = require('./i18next_dictionary/index.cjs');
var import_intlayer_dictionary = require('./intlayer_dictionary/index.cjs');
const buildDictionary = async (dictionaries, configuration = (0, import_config.getConfiguration)()) => {
const { dictionaryOutput } = configuration.content;
if (dictionaryOutput.includes("i18next")) {
await (0, import_i18next_dictionary.buildI18nDictionary)(dictionaries, configuration);
}
if (dictionaryOutput.includes("intlayer")) {
return await (0, import_intlayer_dictionary.buildIntlayerDictionary)(dictionaries, configuration);
}
return [];
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
buildDictionary
});
//# sourceMappingURL=index.cjs.map