mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nitro): use globalThis
This commit is contained in:
parent
de9dffb0d6
commit
5a3f4b7800
@ -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),
|
||||
|
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user