From ff97be15c371a11dd3f9b346933ba3729d4aa16b Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 4 May 2020 10:17:40 -0400 Subject: [PATCH] chore: ensure warn is dev only --- packages/runtime-core/src/apiWatch.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index 322e38e6cf8..4fcc0a850b5 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -187,12 +187,13 @@ function doWatch( } } else { getter = NOOP - warn( - `Invalid watch source: `, - source, - `A watch source can only be a getter/effect function, a ref, ` + - `a reactive object, or an array of these types.` - ) + __DEV__ && + warn( + `Invalid watch source: `, + source, + `A watch source can only be a getter/effect function, a ref, ` + + `a reactive object, or an array of these types.` + ) } if (cb && deep) {