@intlayer/chokidar
Version:
Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.
38 lines • 1.06 kB
JavaScript
import { getAppLogger, getConfiguration } from "@intlayer/config";
import { existsSync, rmSync } from "fs";
const cleanOutputDir = (configuration = getConfiguration()) => {
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
});
};
export {
cleanOutputDir
};
//# sourceMappingURL=cleanOutputDir.mjs.map