DEV Community

loading...

Discussion on: GatsbyJs - Add environment variables

Collapse
raevilman profile image
RD

Hi Andy,

I solved it by adding below to my gatsby-config.js

require("dotenv").config({
  path: `.env.${process.env.NODE_ENV}`,
})
Enter fullscreen mode Exit fullscreen mode

Wrote a note about it at therdnotes.com/building-a-markdown...

HIH ✌