Skip to content

Commit 0c1fe72

Browse files
committed
build: make watch tree-shakable in lean build
1 parent 77103e1 commit 0c1fe72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/runtime-core/src/componentProxy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ComponentInternalInstance, Data, Emit } from './component'
22
import { nextTick, queueJob } from './scheduler'
33
import { instanceWatch } from './apiWatch'
4-
import { EMPTY_OBJ, hasOwn, isGloballyWhitelisted } from '@vue/shared'
4+
import { EMPTY_OBJ, hasOwn, isGloballyWhitelisted, NOOP } from '@vue/shared'
55
import {
66
ExtractComputedReturns,
77
ComponentOptionsBase,
@@ -63,7 +63,7 @@ const publicPropertiesMap: Record<
6363
$options: i => i.type,
6464
$forceUpdate: i => () => queueJob(i.update),
6565
$nextTick: () => nextTick,
66-
$watch: i => instanceWatch.bind(i)
66+
$watch: __FEATURE_OPTIONS__ ? i => instanceWatch.bind(i) : NOOP
6767
}
6868

6969
const enum AccessTypes {

0 commit comments

Comments
 (0)