const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
const require_ESMxCJSHelpers = require('../../../../../../config/dist/esm/utils/ESMxCJSHelpers.cjs');
const require_clearModuleCache = require('../../../../../../config/dist/esm/utils/clearModuleCache.cjs');
const require_built = require('./config/dist/esm/built.cjs');
let node_path = require("node:path");
let node_fs = require("node:fs");

//#region ../chokidar/dist/esm/remote-dictionaries-entry/dist/esm/index.mjs
/**
* @intlayer/dynamic-dictionaries-entry is a package that only returns the dynamic dictionary entry file.
* Using an external package allow to alias it in the bundle configuration (such as webpack).
* The alias allow hot reload the app (such as nextjs) on any dictionary change.
*/
const getRemoteDictionaries = (configuration = require_built.built_default) => {
	const { content, build } = configuration;
	const dictionariesPath = (0, node_path.join)(content.mainDir, `remote_dictionaries.cjs`);
	let dictionaries = {};
	if ((0, node_fs.existsSync)(dictionariesPath)) {
		require_clearModuleCache.clearModuleCache(dictionariesPath);
		dictionaries = (build.require ?? require_ESMxCJSHelpers.configESMxCJSRequire)(dictionariesPath);
	}
	return dictionaries;
};

//#endregion
exports.getRemoteDictionaries = getRemoteDictionaries;
//# sourceMappingURL=index.cjs.map