From 9db3cbbfc1a072675a8d0e53edf3869af115dc60 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Thu, 6 May 2021 14:21:54 +0200 Subject: [PATCH] fix(hmr): don't remove __file key from component type --- packages/runtime-core/src/hmr.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-core/src/hmr.ts b/packages/runtime-core/src/hmr.ts index d2a109a04b..f4c46110d5 100644 --- a/packages/runtime-core/src/hmr.ts +++ b/packages/runtime-core/src/hmr.ts @@ -116,7 +116,7 @@ function reload(id: string, newComp: ComponentOptions | ClassComponent) { newComp = isClassComponent(newComp) ? newComp.__vccOpts : newComp extend(component, newComp) for (const key in component) { - if (!(key in newComp)) { + if (key !== '__file' && !(key in newComp)) { delete (component as any)[key] } } -- 2.47.3