-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15365 from storybookjs/14257-conditional-dotenv
Core: Only use dotenv-webpack when a user has a dotenv file
- Loading branch information
Showing
4 changed files
with
15 additions
and
2 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,10 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
/** | ||
* Is there a .env file in the current directory? | ||
* | ||
* This is the default behavior of `dotenv-webpack-plugin` | ||
* https://github.com/mrsteele/dotenv-webpack/blob/master/src/index.js#L34 | ||
*/ | ||
export const hasDotenv = () => fs.existsSync(path.join('.', '.env')); |
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