We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f80787 commit c6b6aa6Copy full SHA for c6b6aa6
generate-env.js
@@ -13,13 +13,21 @@ const envPath = path.join(__dirname, ".env");
13
let envVars = {};
14
15
if (fs.existsSync(envPath)) {
16
+ // Development: read from .env file
17
const envContent = fs.readFileSync(envPath, "utf8");
18
envContent.split("\n").forEach((line) => {
19
const [key, value] = line.split("=");
20
if (key && value) {
21
envVars[key.trim()] = value.trim();
22
}
23
});
24
+} else {
25
+ // Production: read from process.env
26
+ Object.keys(process.env).forEach((key) => {
27
+ if (key.startsWith('NG_APP_CONTENTSTACK_')) {
28
+ envVars[key] = process.env[key];
29
+ }
30
+ });
31
32
33
const region = getRegionForString(envVars.NG_APP_CONTENTSTACK_REGION);
0 commit comments