const require_index = require('./chokidar/dist/esm/utils/runParallel/index.cjs');
const require_getConfiguration = require('../../../config/dist/esm/configFile/getConfiguration.cjs');
const require_watcher = require('./chokidar/dist/esm/watcher.cjs');

//#region ../@intlayer/cli/dist/esm/build.mjs
/**
* Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.
* Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}
*/
const build = async (options) => {
	const config = require_getConfiguration.getConfiguration(options?.configOptions);
	let parallelProcess = null;
	if (options?.with) {
		parallelProcess = require_index.runParallel(options.with);
		parallelProcess.result.catch(() => {});
	}
	await require_watcher.buildAndWatchIntlayer({
		persistent: options?.watch ?? false,
		skipPrepare: options?.skipPrepare ?? false,
		configuration: config
	});
	if (!options?.watch && parallelProcess) parallelProcess.kill();
};

//#endregion
exports.build = build;
//# sourceMappingURL=build.cjs.map