]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(hmr): don't remove __file key from component type
authorGuillaume Chau <guillaume.b.chau@gmail.com>
Thu, 6 May 2021 12:21:54 +0000 (14:21 +0200)
committerGuillaume Chau <guillaume.b.chau@gmail.com>
Thu, 6 May 2021 12:21:54 +0000 (14:21 +0200)
packages/runtime-core/src/hmr.ts

index d2a109a04b5cc8cb51a513a2d171288a07a289c0..f4c46110d5dd579e8b8d9d6e40ee6b98053c8cae 100644 (file)
@@ -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]
       }
     }