Skip to content

Commit

Permalink
fix: only use dotenv during dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-i committed Dec 29, 2023
1 parent 8b1c776 commit 4b6768a
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 182 deletions.
9 changes: 6 additions & 3 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import type { GatsbyConfig } from 'gatsby';
require(`dotenv`).config({
path: `.env.${process.env.NODE_ENV}`,
});

if (process.env.NODE_ENV === `development`) {
require(`dotenv`).config({
path: `.env.${process.env.NODE_ENV}`,
});
}

const path = require(`path`);

Expand Down
Loading

0 comments on commit 4b6768a

Please sign in to comment.