Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ export const Cfg = {
NAME: 'react-inject-env',

PREFIX: 'REACT_APP_',
VITE_PREFIX: 'VITE_',
PLACEHOLDER_2: 'ReactInjectEnv_'
} as const
4 changes: 2 additions & 2 deletions src/utils/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function retrieveReactEnvCfg(): Record<string, string> {
const env = process.env
const keys = Object.keys(env)
const reactKeys = keys.filter(key => {
return key.startsWith(Cfg.PREFIX) || key === 'PUBLIC_URL'
return key.startsWith(Cfg.PREFIX) || key.startsWith(Cfg.VITE_PREFIX) || key === 'PUBLIC_URL'
})

const envCfg: Record<string, string> = {}
Expand All @@ -21,7 +21,7 @@ export function retrieveDotEnvCfg(): Record<string, string> {

const keys = Object.keys(env)
const reactKeys = keys.filter(key => {
return key.startsWith(Cfg.PREFIX) || key === 'PUBLIC_URL'
return key.startsWith(Cfg.PREFIX) || key.startsWith(Cfg.VITE_PREFIX) || key === 'PUBLIC_URL'
})

const envCfg: Record<string, string> = {}
Expand Down