This repository has been archived by the owner on Sep 6, 2024. It is now read-only.
forked from facebook/create-react-app
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #37 from AckeeCZ/fix/env-specific-build
🐛 Fix environemnt specific build configuration
- Loading branch information
Showing
6 changed files
with
32 additions
and
49 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 |
---|---|---|
@@ -1,4 +1,15 @@ | ||
export const isEnvDevelopment = process.env.NODE_ENV === 'development'; | ||
export const isEnvProduction = process.env.NODE_ENV === 'production'; | ||
const environments = { | ||
PRODUCTION: 'production', | ||
STAGE: 'stage', | ||
DEVELOPMENT: 'development', | ||
}; | ||
|
||
export const currentEnv = process.env.REACT_APP_BUILD_ENV || process.env.NODE_ENV; | ||
|
||
export const isEnvDevelopment = currentEnv === environments.DEVELOPMENT; | ||
export const isEnvStage = currentEnv === environments.STAGE; | ||
export const isEnvProduction = currentEnv === environments.PRODUCTION; | ||
|
||
export const isServerEnv = typeof window === 'undefined'; | ||
|
||
export default environments; |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export { default as env } from './env'; | ||
export * from './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
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