fix(nitro): use globalThis

This commit is contained in:
Pooya Parsa 2021-04-21 17:35:20 +02:00
parent de9dffb0d6
commit 5a3f4b7800
2 changed files with 2 additions and 1 deletions

View File

@ -131,6 +131,7 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
values: {
'process.env.NODE_ENV': nitroContext._nuxt.dev ? '"development"' : '"production"',
'typeof window': '"undefined"',
'global.': 'globalThis.',
'process.env.ROUTER_BASE': JSON.stringify(nitroContext._nuxt.routerBase),
'process.env.PUBLIC_PATH': JSON.stringify(nitroContext._nuxt.publicPath),
'process.env.NUXT_STATIC_BASE': JSON.stringify(nitroContext._nuxt.staticAssets.base),

View File

@ -3,7 +3,7 @@ import { createRenderer } from '#nitro-vue-renderer'
const _renderer = createRenderer({})
// @ts-ignore
const __VUE_SSR_CONTEXT__ = global.__VUE_SSR_CONTEXT__ = {}
const __VUE_SSR_CONTEXT__ = globalThis.__VUE_SSR_CONTEXT__ = {}
export function renderToString (component, context) {
return new Promise((resolve, reject) => {