@intlayer/config
Version:
Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.
32 lines (31 loc) • 1.3 kB
JavaScript
//#region src/built.browser.ts
/**
* Proxy that reads each top-level key from `window.INTLAYER_CONFIG` lazily.
* This avoids the module-evaluation timing issue: the proxy is safe to import
* at the top of any file because the actual `window.INTLAYER_CONFIG` value is
* only read when a property is first accessed.
*/
const configuration = new Proxy({}, {
get(_target, prop) {
return (typeof window !== "undefined" ? window.INTLAYER_CONFIG : void 0)?.[prop];
},
has(_target, prop) {
const config = typeof window !== "undefined" ? window.INTLAYER_CONFIG : void 0;
return config != null && prop in config;
}
});
const internationalization = configuration.internationalization;
const dictionary = configuration.dictionary;
const routing = configuration.routing;
const content = configuration.content;
const system = configuration.system;
const editor = configuration.editor;
const log = configuration.log;
const ai = configuration.ai;
const build = configuration.build;
const compiler = configuration.compiler;
const schemas = configuration.schemas;
const plugins = configuration.plugins;
//#endregion
export { ai, build, compiler, content, configuration as default, dictionary, editor, internationalization, log, plugins, routing, schemas, system };
//# sourceMappingURL=built.browser.mjs.map