From 8dbf083133bc3047d4a1fb49dfafdda5ea55139f Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 9 Nov 2022 11:41:26 +0800 Subject: [PATCH] build: put ssrContext warning behind __DEV__ flag --- packages/runtime-core/src/helpers/useSsrContext.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/runtime-core/src/helpers/useSsrContext.ts b/packages/runtime-core/src/helpers/useSsrContext.ts index 5b75b6f80..e48a69a40 100644 --- a/packages/runtime-core/src/helpers/useSsrContext.ts +++ b/packages/runtime-core/src/helpers/useSsrContext.ts @@ -7,10 +7,11 @@ export const useSSRContext = >() => { if (!__GLOBAL__) { const ctx = inject(ssrContextKey) if (!ctx) { - warn( - `Server rendering context not provided. Make sure to only call ` + - `useSSRContext() conditionally in the server build.` - ) + __DEV__ && + warn( + `Server rendering context not provided. Make sure to only call ` + + `useSSRContext() conditionally in the server build.` + ) } return ctx } else if (__DEV__) {