Skip to content

Commit

Permalink
fix(docz-core): log errors that happen in gatsby-config
Browse files Browse the repository at this point in the history
  • Loading branch information
rakannimer committed Nov 29, 2019
1 parent c0dc74d commit fe1e2da
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions core/docz-core/templates/gatsby-config.tpl.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
const { mergeWith } = require('lodash/fp')
const fs = require('fs-extra')

let custom
try {
custom = require('./gatsby-config.custom')
} catch(err) {
custom = {}
let custom = {}
const hasGatsbyConfig = fs.existsSync('./gatsby-config.custom.js')

if (hasGatsbyConfig) {
try {
custom = require('./gatsby-config.custom')
} catch (err) {
console.error(
`Failed to load your gatsby-config.js file : `,
JSON.stringify(err)
)
}
}

const config = {
Expand Down

0 comments on commit fe1e2da

Please sign in to comment.