{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * @intlayer/unmerged-dictionaries-entry is a package that only returns the unmerged dictionary entry file.\n * Using an external package allow to alias it in the bundle configuration (such as webpack).\n * The alias allow hot reload the app (such as nextjs) on any dictionary change.\n */\n\nimport { ESMxCJSRequire, getConfiguration } from '@intlayer/config';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\n// @ts-ignore intlayer declared for module augmentation\nimport type { Dictionary, IntlayerDictionaryTypesConnector } from 'intlayer';\n\nexport const getUnmergedDictionaries = () => {\n  const { content } = getConfiguration();\n\n  const dictionariesPath = join(content.mainDir, 'unmerged_dictionaries.cjs');\n  let dictionaries: Record<\n    IntlayerDictionaryTypesConnector['key'],\n    Dictionary[]\n  > = {};\n\n  if (existsSync(dictionariesPath)) {\n    delete ESMxCJSRequire.cache[dictionariesPath];\n    dictionaries = ESMxCJSRequire(dictionariesPath);\n  }\n\n  return dictionaries;\n};\n\nexport default (() => getUnmergedDictionaries())();\n"],"mappings":"AAMA,SAAS,gBAAgB,wBAAwB;AACjD,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AAId,MAAM,0BAA0B,MAAM;AAC3C,QAAM,EAAE,QAAQ,IAAI,iBAAiB;AAErC,QAAM,mBAAmB,KAAK,QAAQ,SAAS,2BAA2B;AAC1E,MAAI,eAGA,CAAC;AAEL,MAAI,WAAW,gBAAgB,GAAG;AAChC,WAAO,eAAe,MAAM,gBAAgB;AAC5C,mBAAe,eAAe,gBAAgB;AAAA,EAChD;AAEA,SAAO;AACT;AAEA,IAAO,iBAAS,MAAM,wBAAwB,GAAG;","names":[]}