Skip to content

Commit

Permalink
fix: revert package.json change should trigger server restart (#15519
Browse files Browse the repository at this point in the history
…)"

This reverts commit 260ebbf.
  • Loading branch information
patak-dev committed Jan 10, 2024
1 parent 653a48c commit 52a2f6d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/vite/src/node/server/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ export async function handleHMRUpdate(
const isConfigDependency = config.configFileDependencies.some(
(name) => file === name,
)
const isPackageJson = fileName === 'package.json'

const isEnv =
config.inlineConfig.envFile !== false &&
getEnvFilesForMode(config.mode, config.envDir).includes(fileName)
if (isConfig || isConfigDependency || isPackageJson || isEnv) {
if (isConfig || isConfigDependency || isEnv) {
// auto restart server
debugHmr?.(`[config change] ${colors.dim(shortFile)}`)
config.logger.info(
Expand Down

0 comments on commit 52a2f6d

Please sign in to comment.