( mode: string, envDir: string | false, )
| 11 | const debug = createDebugger('vite:env') |
| 12 | |
| 13 | export function getEnvFilesForMode( |
| 14 | mode: string, |
| 15 | envDir: string | false, |
| 16 | ): string[] { |
| 17 | if (envDir !== false) { |
| 18 | return [ |
| 19 | /** default file */ `.env`, |
| 20 | /** local file */ `.env.local`, |
| 21 | /** mode file */ `.env.${mode}`, |
| 22 | /** mode local file */ `.env.${mode}.local`, |
| 23 | ].map((file) => normalizePath(path.join(envDir, file))) |
| 24 | } |
| 25 | |
| 26 | return [] |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Load `.env` files within the `envDir` and merge them with the matching |
no test coverage detected