Skip to content

Commit

Permalink
fix(hmr): normalize env files path (#15584)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea authored Jan 16, 2024
1 parent 644d120 commit d0f1d2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'node:fs'
import path from 'node:path'
import { parse } from 'dotenv'
import { expand } from 'dotenv-expand'
import { arraify, tryStatSync } from './utils'
import { arraify, normalizePath, tryStatSync } from './utils'
import type { UserConfig } from './config'

export function getEnvFilesForMode(mode: string, envDir: string): string[] {
Expand All @@ -11,7 +11,7 @@ export function getEnvFilesForMode(mode: string, envDir: string): string[] {
/** local file */ `.env.local`,
/** mode file */ `.env.${mode}`,
/** mode local file */ `.env.${mode}.local`,
].map((file) => path.join(envDir, file))
].map((file) => normalizePath(path.join(envDir, file)))
}

export function loadEnv(
Expand Down

0 comments on commit d0f1d2e

Please sign in to comment.