Skip to content

Commit

Permalink
add .env.* support
Browse files Browse the repository at this point in the history
  • Loading branch information
addy-pathania committed Feb 16, 2024
1 parent 913d35e commit 93fe63d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import path from 'path';
import { constantCase } from 'constant-case';
import { JssConfig } from 'lib/config';
import { jssConfigFactory } from './config';
import { loadEnvConfig } from '@next/env';

const projectDir = process.cwd();
loadEnvConfig(projectDir);

/*
CONFIG GENERATION
Expand All @@ -15,7 +19,8 @@ const defaultConfig: JssConfig = {
sitecoreApiKey: process.env[`${constantCase('sitecoreApiKey')}`],
sitecoreApiHost: process.env[`${constantCase('sitecoreApiHost')}`],
sitecoreSiteName:
process.env[`${constantCase('sitecoreSiteName')}`] || process.env[`${constantCase('jssAppName')}`],
process.env[`${constantCase('sitecoreSiteName')}`] ||
process.env[`${constantCase('jssAppName')}`],
graphQLEndpointPath: process.env[`${constantCase('graphQLEndpointPath')}`],
defaultLanguage: process.env[`${constantCase('defaultLanguage')}`],
graphQLEndpoint: process.env[`${constantCase('graphQLEndpoint')}`],
Expand Down

0 comments on commit 93fe63d

Please sign in to comment.