From: Evan You Date: Wed, 9 Nov 2022 03:41:26 +0000 (+0800) Subject: build: put ssrContext warning behind __DEV__ flag X-Git-Tag: v3.2.43~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8dbf083133bc3047d4a1fb49dfafdda5ea55139f;p=thirdparty%2Fvuejs%2Fcore.git build: put ssrContext warning behind __DEV__ flag --- diff --git a/packages/runtime-core/src/helpers/useSsrContext.ts b/packages/runtime-core/src/helpers/useSsrContext.ts index 5b75b6f806..e48a69a40d 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__) {