mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-22 01:46:51 +01:00
production check for env vars
This commit is contained in:
parent
52b455b109
commit
21071a1e0f
@ -1,7 +1,8 @@
|
||||
const UMAMI_SCRIPT_URL = process.env.GATSBY_UMAMI_SCRIPT_URL
|
||||
const UMAMI_WEBSITE_ID = process.env.GATSBY_UMAMI_WEBSITE_ID
|
||||
const isProduction = process.env.NODE_ENV === 'production'
|
||||
|
||||
if (!UMAMI_SCRIPT_URL || !UMAMI_WEBSITE_ID) {
|
||||
if (isProduction && (!UMAMI_SCRIPT_URL || !UMAMI_WEBSITE_ID)) {
|
||||
throw new Error('Missing Umami environment variables')
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user