import { runParallel, watch } from "@intlayer/chokidar";
import { getAppLogger, getConfiguration } from "@intlayer/config";

//#region src/watch.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 watchContentDeclaration = async (options) => {
	const appLogger = getAppLogger(getConfiguration(options?.configOptions));
	if (options?.with) runParallel(options.with).result.catch(() => {});
	appLogger("Watching Intlayer content declarations");
	watch({
		persistent: true,
		skipPrepare: options?.skipPrepare ?? false
	});
};

//#endregion
export { watchContentDeclaration };
//# sourceMappingURL=watch.mjs.map