TestGatsbySanity/web/gatsby-config.js
2019-05-09 10:15:41 -05:00

25 lines
576 B
JavaScript

// Load variables from `.env` as soon as possible
require('dotenv').config({
path: `.env.${process.env.NODE_ENV || 'development'}`
})
const clientConfig = require('./client-config')
const token = process.env.SANITY_READ_TOKEN
const isProd = process.env.NODE_ENV === 'production'
module.exports = {
plugins: [
'gatsby-plugin-postcss',
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-source-sanity',
options: {
...clientConfig.sanity,
token,
watchMode: !isProd,
overlayDrafts: !isProd && token
}
}
]
}