Skip to content

Commit

Permalink
update gatsby-config.js and update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwiemer committed May 29, 2018
1 parent df121b9 commit 0d3ce23
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "gatsby-standard"
"extends": "gatsby-standard",
"rules": {
"no-unsafe-finally": "off"
}
}
13 changes: 8 additions & 5 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
require('dotenv').config()
const config = require('./src/utils/siteConfig')
let contentfulConfig

// If the contentfulConfig can't be found assume the site is being built via Netlify with production environment variables
try {
var contentfulConfig = require('./.contentful')
contentfulConfig = require('./.contentful')
} catch (e) {
// eslint-disable-next-line
var contentfulConfig = {
contentfulConfig = {
production: {
spaceId: process.env.SPACE_ID,
accessToken: process.env.ACCESS_TOKEN,
},
}
} finally {
const { spaceId, accessToken } = contentfulConfig.production
if (!spaceId || !accessToken) {
throw new Error('Contentful space ID and access token need to be provided.')
}
}

module.exports = {
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@
"repository": "https://github.com/ryanwiemer/gatsby-starter-gcn",
"author": "Ryan Wiemer <[email protected]>",
"dependencies": {
"chalk": "^2.3.2",
"chalk": "^2.4.1",
"contentful-import": "^7.0.1",
"dotenv": "^5.0.1",
"gatsby": "^1.9.261",
"gatsby-image": "^1.0.45",
"gatsby-link": "^1.6.40",
"gatsby-plugin-canonical-urls": "^1.0.16",
"gatsby-image": "^1.0.51",
"gatsby-link": "^1.6.44",
"gatsby-plugin-canonical-urls": "^1.0.18",
"gatsby-plugin-feed": "^1.3.22",
"gatsby-plugin-google-analytics": "^1.0.31",
"gatsby-plugin-manifest": "^1.0.22",
"gatsby-plugin-netlify": "^1.0.19",
"gatsby-plugin-nprogress": "^1.0.14",
"gatsby-plugin-offline": "^1.0.16",
"gatsby-plugin-react-helmet": "^2.0.10",
"gatsby-plugin-react-helmet": "^2.0.11",
"gatsby-plugin-sitemap": "^1.2.23",
"gatsby-plugin-styled-components": "^2.0.11",
"gatsby-remark-prismjs": "^1.2.24",
"gatsby-remark-prismjs": "^2.0.2",
"gatsby-source-contentful": "^1.3.51",
"gatsby-source-filesystem": "^1.5.36",
"gatsby-transformer-remark": "^1.7.41",
"inquirer": "^5.2.0",
"lodash": "^4.17.5",
"lodash": "^4.17.10",
"path": "^0.12.7",
"prismjs": "^1.14.0",
"react-helmet": "^5.2.0",
"styled-components": "^3.2.5",
"styled-components": "^3.3.0",
"whatwg-fetch": "^2.0.4"
},
"keywords": [
Expand All @@ -51,8 +51,8 @@
"devDependencies": {
"eslint": "^4.19.1",
"eslint-config-gatsby-standard": "^1.2.1",
"prettier": "^1.12.1",
"stylelint": "9.1.3",
"prettier": "^1.13.2",
"stylelint": "9.2.1",
"stylelint-config-prettier": "^3.2.0",
"stylelint-config-standard": "^18.2.0",
"stylelint-config-styled-components": "^0.1.1",
Expand Down

0 comments on commit 0d3ce23

Please sign in to comment.