const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
let __intlayer_chokidar = require("@intlayer/chokidar");
let __intlayer_config = require("@intlayer/config");

//#region src/build.ts
/**
* 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 = (0, __intlayer_config.getConfiguration)(options?.configOptions);
	let parallelProcess = null;
	if (options?.with) {
		parallelProcess = (0, __intlayer_chokidar.runParallel)(options.with);
		parallelProcess.result.catch(() => {});
	}
	await (0, __intlayer_chokidar.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