From: Guillaume Chau Date: Thu, 6 May 2021 12:21:54 +0000 (+0200) Subject: fix(hmr): don't remove __file key from component type X-Git-Tag: v3.1.0-beta.1~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9db3cbbfc1a072675a8d0e53edf3869af115dc60;p=thirdparty%2Fvuejs%2Fcore.git fix(hmr): don't remove __file key from component type --- 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] } }