Handle missing PUBLIC_DOCS_URL in production builds

This commit is contained in:
Alexa Amundson
2025-11-20 17:33:58 -06:00
parent 66673d2c01
commit 9a5a4437a5

View File

@@ -10,9 +10,13 @@ const isProdLike = env !== 'development';
function readEnv(name, fallback = '') { function readEnv(name, fallback = '') {
const value = process.env[name] || fallback; const value = process.env[name] || fallback;
if (isProdLike && name === 'PUBLIC_DOCS_URL' && !value) { if (isProdLike && name === 'PUBLIC_DOCS_URL' && !value) {
throw new Error('PUBLIC_DOCS_URL must be defined in non-development environments'); console.warn(
'PUBLIC_DOCS_URL was not provided; falling back to default for production-like build'
);
} }
return value; return value;
} }