Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Valid env files include: .env.tusken .env.${NODE_ENV} .env The order they are listed is the precedence.
- Loading branch information
1 parent
b87487d
commit b573f45
Showing
5 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { config as loadDotEnv } from 'dotenv' | ||
import escalade from './escalade/sync' | ||
|
||
export function dotenv() { | ||
const envFiles = [ | ||
'.env.tusken', | ||
'.env.' + (process.env.NODE_ENV || 'development'), | ||
'.env', | ||
] | ||
|
||
const envPath = escalade(process.cwd(), (dir, files) => { | ||
const file = envFiles.find(f => files.includes(f)) | ||
if (file) { | ||
return file | ||
} | ||
}) | ||
|
||
loadDotEnv({ | ||
path: envPath, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.