@intlayer/config
Version:
Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.
46 lines (44 loc) • 1.63 kB
JavaScript
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
//#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
exports.ai = ai;
exports.build = build;
exports.compiler = compiler;
exports.content = content;
exports.default = configuration;
exports.dictionary = dictionary;
exports.editor = editor;
exports.internationalization = internationalization;
exports.log = log;
exports.plugins = plugins;
exports.routing = routing;
exports.schemas = schemas;
exports.system = system;
//# sourceMappingURL=built.browser.cjs.map