Skip to content

Commit

Permalink
fix(server): use a more strict isEnv judgement
Browse files Browse the repository at this point in the history
  • Loading branch information
Amorites committed Nov 9, 2021
1 parent db4a36d commit a110819
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function handleHMRUpdate(
const isConfigDependency = config.configFileDependencies.some(
(name) => file === path.resolve(name)
)
const isEnv = config.inlineConfig.envFile !== false && file.startsWith('.env')
const isEnv = config.inlineConfig.envFile !== false && (file === '.env' || file.startsWith('.env.'))
if (isConfig || isConfigDependency || isEnv) {
// auto restart server
debugHmr(`[config change] ${chalk.dim(shortFile)}`)
Expand Down

0 comments on commit a110819

Please sign in to comment.