build: put ssrContext warning behind __DEV__ flag

This commit is contained in:
Evan You 2022-11-09 11:41:26 +08:00
parent f023d49a49
commit 8dbf083133
1 changed files with 5 additions and 4 deletions

View 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__) {