File tree 2 files changed +10
-5
lines changed
packages/runtime-core/src
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export interface HMRRuntime {
25
25
// it easier to be used in toolings like vue-loader
26
26
// Note: for a component to be eligible for HMR it also needs the __hmrId option
27
27
// to be set so that its instances can be registered / removed.
28
- if ( __DEV__ ) {
28
+ if ( __DEV__ && ( __BROWSER__ || __TEST__ ) ) {
29
29
const globalObject : any =
30
30
typeof global !== 'undefined'
31
31
? global
Original file line number Diff line number Diff line change @@ -885,7 +885,7 @@ function baseCreateRenderer(
885
885
invokeDirectiveHook ( n2 , n1 , parentComponent , 'beforeUpdate' )
886
886
}
887
887
888
- if ( __DEV__ && isHmrUpdating ) {
888
+ if ( __DEV__ && ( __BROWSER__ || __TEST__ ) && isHmrUpdating ) {
889
889
// HMR updated, force full diff
890
890
patchFlag = 0
891
891
optimized = false
@@ -986,7 +986,12 @@ function baseCreateRenderer(
986
986
parentSuspense ,
987
987
areChildrenSVG
988
988
)
989
- if ( __DEV__ && parentComponent && parentComponent . type . __hmrId ) {
989
+ if (
990
+ __DEV__ &&
991
+ ( __BROWSER__ || __TEST__ ) &&
992
+ parentComponent &&
993
+ parentComponent . type . __hmrId
994
+ ) {
990
995
traverseStaticChildren ( n1 , n2 )
991
996
}
992
997
} else if ( ! optimized ) {
@@ -1238,7 +1243,7 @@ function baseCreateRenderer(
1238
1243
parentSuspense
1239
1244
) )
1240
1245
1241
- if ( __DEV__ && instance . type . __hmrId ) {
1246
+ if ( __DEV__ && ( __BROWSER__ || __TEST__ ) && instance . type . __hmrId ) {
1242
1247
registerHMR ( instance )
1243
1248
}
1244
1249
@@ -2109,7 +2114,7 @@ function baseCreateRenderer(
2109
2114
parentSuspense : SuspenseBoundary | null ,
2110
2115
doRemove ?: boolean
2111
2116
) => {
2112
- if ( __DEV__ && instance . type . __hmrId ) {
2117
+ if ( __DEV__ && ( __BROWSER__ || __TEST__ ) && instance . type . __hmrId ) {
2113
2118
unregisterHMR ( instance )
2114
2119
}
2115
2120
You can’t perform that action at this time.
0 commit comments