UNPKG

@intlayer/chokidar

Version:

Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.

1 lines 1.19 kB
{"version":3,"sources":["../../src/cleanOutputDir.ts"],"sourcesContent":["import { existsSync, rmSync } from 'fs';\nimport { getConfiguration } from '@intlayer/config';\nimport { createDictionaryEntryPoint } from './transpiler/dictionary_to_main/createDictionaryEntryPoint';\n\nexport const cleanOutputDir = (configuration = getConfiguration()) => {\n const { resultDir, typesDir, dictionariesDir } = configuration.content;\n\n if (existsSync(resultDir)) {\n // Delete the dictionary directory\n if (existsSync(dictionariesDir)) {\n rmSync(dictionariesDir, { recursive: true });\n }\n\n // Delete the types directory\n if (existsSync(typesDir)) {\n rmSync(typesDir, { recursive: true });\n }\n }\n\n createDictionaryEntryPoint(configuration);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAmC;AACnC,oBAAiC;AACjC,wCAA2C;AAEpC,MAAM,iBAAiB,CAAC,oBAAgB,gCAAiB,MAAM;AACpE,QAAM,EAAE,WAAW,UAAU,gBAAgB,IAAI,cAAc;AAE/D,UAAI,sBAAW,SAAS,GAAG;AAEzB,YAAI,sBAAW,eAAe,GAAG;AAC/B,4BAAO,iBAAiB,EAAE,WAAW,KAAK,CAAC;AAAA,IAC7C;AAGA,YAAI,sBAAW,QAAQ,GAAG;AACxB,4BAAO,UAAU,EAAE,WAAW,KAAK,CAAC;AAAA,IACtC;AAAA,EACF;AAEA,oEAA2B,aAAa;AAC1C;","names":[]}