From cc56bdb3f479011e7ce30cfdc95e270523eb8cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 24 Jul 2018 16:07:32 +0200 Subject: [PATCH] use fitting configuration depending on node environment --- gatsby-config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index 75c49da..6196159 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -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,