@intlayer/config
Version:
Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.
110 lines • 4.9 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var vite_exports = {};
__export(vite_exports, {
extractViteEnvVariable: () => extractViteEnvVariable
});
module.exports = __toCommonJS(vite_exports);
var import_logger = require('../../logger.cjs');
var import_undefined_platform = require('./undefined_platform.cjs');
const import_meta = {};
const extractViteEnvVariable = () => {
if (!import_meta.env) {
(0, import_logger.logger)("Vite env variables cannot be loaded on a commonjs environment.", {
level: "error"
});
return (0, import_undefined_platform.extractEmptyEnvVariable)();
}
const internationalization = {
locales: import_meta.env.VITE_INTLAYER_LOCALES,
requiredLocales: import_meta.env.VITE_INTLAYER_REQUIRED_LOCALES,
strictMode: import_meta.env.VITE_INTLAYER_STRICT_MODE,
defaultLocale: import_meta.env.VITE_INTLAYER_DEFAULT_LOCALE
};
const middleware = {
headerName: import_meta.env.VITE_INTLAYER_HEADER_NAME,
cookieName: import_meta.env.VITE_INTLAYER_COOKIE_NAME,
prefixDefault: import_meta.env.VITE_INTLAYER_PREFIX_DEFAULT,
basePath: import_meta.env.VITE_INTLAYER_BASE_PATH,
serverSetCookie: import_meta.env.VITE_INTLAYER_SERVER_SET_COOKIE,
noPrefix: import_meta.env.VITE_INTLAYER_NO_PREFIX
};
const content = {
fileExtensions: import_meta.env.VITE_INTLAYER_FILE_EXTENSIONS,
baseDir: import_meta.env.VITE_INTLAYER_BASE_DIR,
contentDir: import_meta.env.VITE_INTLAYER_CONTENT_DIR,
excludedPath: import_meta.env.VITE_INTLAYER_EXCLUDED_PATH,
dictionariesDir: import_meta.env.VITE_INTLAYER_RESULT_DIR,
moduleAugmentationDir: import_meta.env.VITE_INTLAYER_MODULE_AUGMENTATION_DIR,
unmergedDictionariesDir: import_meta.env.VITE_INTLAYER_UNMERGED_DICTIONARIES_DIR,
dynamicDictionariesDir: import_meta.env.VITE_INTLAYER_DYNAMIC_DICTIONARIES_DIR,
i18nextResourcesDir: import_meta.env.VITE_INTLAYER_I18N_DICTIONARIES_DIR,
reactIntlMessagesDir: import_meta.env.VITE_INTLAYER_REACT_INTL_DICTIONARIES_DIR,
typesDir: import_meta.env.VITE_INTLAYER_TYPE_DIR,
mainDir: import_meta.env.VITE_INTLAYER_MAIN_DIR,
configDir: import_meta.env.VITE_INTLAYER_CONFIG_DIR,
watchedFilesPattern: import_meta.env.VITE_INTLAYER_WATCHED_FILES_PATTERN,
watchedFilesPatternWithPath: import_meta.env.VITE_INTLAYER_WATCHED_FILES_PATTERN_WITH_PATH,
outputFilesPatternWithPath: import_meta.env.VITE_INTLAYER_OUTPUT_FILES_PATTERN_WITH_PATH,
dictionaryOutput: import_meta.env.VITE_INTLAYER_DICTIONARY_OUTPUT,
watch: import_meta.env.VITE_INTLAYER_WATCH
};
const editor = {
applicationURL: import_meta.env.VITE_INTLAYER_APPLICATION_URL,
editorURL: import_meta.env.VITE_INTLAYER_EDITOR_URL,
cmsURL: import_meta.env.VITE_INTLAYER_CMS_URL,
backendURL: import_meta.env.VITE_INTLAYER_BACKEND_URL,
port: import_meta.env.VITE_INTLAYER_PORT,
enabled: import_meta.env.VITE_INTLAYER_ENABLED,
clientId: import_meta.env.VITE_INTLAYER_CLIENT_ID,
clientSecret: import_meta.env.VITE_INTLAYER_CLIENT_SECRET,
dictionaryPriorityStrategy: import_meta.env.VITE_INTLAYER_DICTIONARY_PRIORITY_STRATEGY,
hotReload: import_meta.env.VITE_INTLAYER_HOT_RELOAD
};
const log = {
mode: import_meta.env.VITE_INTLAYER_LOG_MODE,
prefix: import_meta.env.VITE_INTLAYER_LOG_PREFIX
};
const ai = {
provider: import_meta.env.VITE_INTLAYER_AI_PROVIDER,
model: import_meta.env.VITE_INTLAYER_AI_MODEL,
temperature: import_meta.env.VITE_INTLAYER_AI_TEMPERATURE,
apiKey: import_meta.env.VITE_INTLAYER_AI_API_KEY,
applicationContext: import_meta.env.VITE_INTLAYER_AI_APPLICATION_CONTEXT
};
const build = {
optimize: import_meta.env.VITE_INTLAYER_BUILD_OPTIMIZE,
activateDynamicImport: import_meta.env.VITE_INTLAYER_BUILD_ACTIVATE_DYNAMIC_IMPORT,
traversePattern: import_meta.env.VITE_INTLAYER_BUILD_TRAVERSE_PATTERN
};
return {
internationalization,
middleware,
content,
editor,
log,
ai,
build
};
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
extractViteEnvVariable
});
//# sourceMappingURL=vite.cjs.map