import { getAppLogger } from "./config/dist/esm/logger.mjs";
import { existsSync, rmSync } from "node:fs";

//#region ../@intlayer/webpack/dist/esm/chokidar/dist/esm/cleanOutputDir.mjs
const cleanOutputDir = (configuration) => {
	const { dictionariesDir, unmergedDictionariesDir, dynamicDictionariesDir, mainDir, typesDir, configDir } = configuration.content;
	const appLogger = getAppLogger(configuration);
	if (existsSync(dictionariesDir)) rmSync(dictionariesDir, { recursive: true });
	if (existsSync(unmergedDictionariesDir)) rmSync(unmergedDictionariesDir, { recursive: true });
	if (existsSync(dynamicDictionariesDir)) rmSync(dynamicDictionariesDir, { recursive: true });
	if (existsSync(mainDir)) rmSync(mainDir, { recursive: true });
	if (existsSync(typesDir)) rmSync(typesDir, { recursive: true });
	if (existsSync(configDir)) rmSync(configDir, { recursive: true });
	appLogger("Output directory cleaned", { isVerbose: true });
};

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