Skip to content

Commit

Permalink
Change process.env to Vite import.meta.env: https://vitejs.dev/guide/…
Browse files Browse the repository at this point in the history
  • Loading branch information
HRemonen committed Apr 12, 2023
1 parent 0bf8797 commit 3bf1b89
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
export const inDevelopment = process.env.NODE_ENV === 'development'
export const inDevelopment = import.meta.env.NODE_ENV === 'development'

export const inStaging = process.env.REACT_APP_STAGING === 'true'
export const inStaging = import.meta.env.REACT_APP_STAGING === 'true'

export const inProduction = !inStaging && process.env.NODE_ENV === 'production'
export const inProduction =
!inStaging && import.meta.env.NODE_ENV === 'production'

export const inE2EMode = process.env.REACT_APP_E2E === 'true'
export const inE2EMode = import.meta.env.REACT_APP_E2E === 'true'

export const GIT_SHA = process.env.REACT_APP_GIT_SHA || ''
export const GIT_SHA = import.meta.env.REACT_APP_GIT_SHA || ''

export const PUBLIC_URL = process.env.PUBLIC_URL || ''
export const PUBLIC_URL = import.meta.env.PUBLIC_URL || ''

export const DEFAULT_SURVEY_NAME =
process.env.DEFAULT_SURVEY_NAME || 'testSurvey'
import.meta.env.DEFAULT_SURVEY_NAME || 'testSurvey'

export const FORM_DATA_KEY = 'curre_local_save'

1 comment on commit 3bf1b89

@HRemonen
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More information and other options also found here: vitejs/vite#1973

Please sign in to comment.