UNPKG

next-intl-split

Version:

A loader for next-intl to split translation files properly.

3 lines (2 loc) 648 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("path"),r=require("fs"),t=require("../load/index.cjs"),s=require("../write/index.cjs");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(e);exports.mergeMessages=e=>{if(!e.startsWith("./"))throw new Error("Please provide the RELATIVE path to the dictionaries folder. Like, ./src/i18n/dictionaries");const i=o.default.resolve(process.cwd(),e),a=(e=>r.existsSync(e))(i);if(!a)throw new Error(`The provided path to the dictionaries does not exist! ${i}`);const d=t.loadMessages(i);s.writeMessages(i,d)}; //# sourceMappingURL=index.cjs.map