From 0c1fe72dcf1d688fabf3b2b420dbe08da116a2ca Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 17 Feb 2020 11:02:15 -0500 Subject: [PATCH] build: make watch tree-shakable in lean build --- packages/runtime-core/src/componentProxy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/componentProxy.ts b/packages/runtime-core/src/componentProxy.ts index 5d8d4364..b2ff4baa 100644 --- a/packages/runtime-core/src/componentProxy.ts +++ b/packages/runtime-core/src/componentProxy.ts @@ -1,7 +1,7 @@ import { ComponentInternalInstance, Data, Emit } from './component' import { nextTick, queueJob } from './scheduler' import { instanceWatch } from './apiWatch' -import { EMPTY_OBJ, hasOwn, isGloballyWhitelisted } from '@vue/shared' +import { EMPTY_OBJ, hasOwn, isGloballyWhitelisted, NOOP } from '@vue/shared' import { ExtractComputedReturns, ComponentOptionsBase, @@ -63,7 +63,7 @@ const publicPropertiesMap: Record< $options: i => i.type, $forceUpdate: i => () => queueJob(i.update), $nextTick: () => nextTick, - $watch: i => instanceWatch.bind(i) + $watch: __FEATURE_OPTIONS__ ? i => instanceWatch.bind(i) : NOOP } const enum AccessTypes {