fix(ssr): avoid hard-coded ssr checks in cjs builds

This commit is contained in:
Evan You
2020-01-29 09:49:17 -05:00
parent 6b1ce00621
commit bc07e95ca8
8 changed files with 31 additions and 19 deletions

View File

@@ -106,7 +106,7 @@ import { createComponentInstance, setupComponent } from './component'
import { renderComponentRoot } from './componentRenderUtils'
import { normalizeVNode } from './vnode'
// SSR utils are only exposed in SSR builds.
// SSR utils are only exposed in cjs builds.
const _ssrUtils = {
createComponentInstance,
setupComponent,
@@ -114,7 +114,7 @@ const _ssrUtils = {
normalizeVNode
}
export const ssrUtils = (__SSR__ ? _ssrUtils : null) as typeof _ssrUtils
export const ssrUtils = (__NODE_JS__ ? _ssrUtils : null) as typeof _ssrUtils
// Types -----------------------------------------------------------------------