Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
use fitting configuration depending on node environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Rötsch authored and axe312ger committed Jul 24, 2018
1 parent 79b5920 commit cc56bdb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
let contentfulConfig

try {
contentfulConfig = require('./.contentful')
const configFile = require('./.contentful')
contentfulConfig = process.env.NODE_ENV === 'production'
? configFile.production
: configFile.development
} catch (_) {
contentfulConfig = {
spaceId: process.env.CONTENTFUL_SPACE_ID,
Expand Down

0 comments on commit cc56bdb

Please sign in to comment.