From 3c46f97bcc3096ee637525ea6bf476d8ba10ab0d Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Tue, 12 Mar 2024 11:38:44 +0100 Subject: [PATCH] chore: normalize path --- packages/vite/src/module-runner/hmrHandler.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/vite/src/module-runner/hmrHandler.ts b/packages/vite/src/module-runner/hmrHandler.ts index 839fa266ba3c66..e15f88c6f91c74 100644 --- a/packages/vite/src/module-runner/hmrHandler.ts +++ b/packages/vite/src/module-runner/hmrHandler.ts @@ -1,5 +1,5 @@ import type { HMRPayload } from 'types/hmrPayload' -import { unwrapId } from '../shared/utils' +import { slash, unwrapId } from '../shared/utils' import type { ModuleRunner } from './runner' // updates to HMR should go one after another. It is possible to trigger another update during the invalidation for example. @@ -46,7 +46,10 @@ export async function handleHMRPayload( case 'full-reload': { const { triggeredBy } = payload const clearEntrypoints = triggeredBy - ? getModulesEntrypoints(runner, getModulesByFile(runner, triggeredBy)) + ? getModulesEntrypoints( + runner, + getModulesByFile(runner, slash(triggeredBy)), + ) : findAllEntrypoints(runner) if (!clearEntrypoints.size) break