]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
build: put ssrContext warning behind __DEV__ flag
authorEvan You <yyx990803@gmail.com>
Wed, 9 Nov 2022 03:41:26 +0000 (11:41 +0800)
committerEvan You <yyx990803@gmail.com>
Wed, 9 Nov 2022 03:41:26 +0000 (11:41 +0800)
packages/runtime-core/src/helpers/useSsrContext.ts

index 5b75b6f806ff337d835fbf7c94a1f218e72bb78c..e48a69a40da5534d3f2c4fb2b83343b77bdd249e 100644 (file)
@@ -7,10 +7,11 @@ export const useSSRContext = <T = Record<string, any>>() => {
   if (!__GLOBAL__) {
     const ctx = inject<T>(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__) {