fix(nitro): replace global. in fewer instances (#3107)

This commit is contained in:
Daniel Roe 2022-02-07 20:50:39 +00:00 committed by GitHub
parent 790a54897a
commit 22e6c857f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,7 +156,7 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
values: { values: {
'process.env.NODE_ENV': nitroContext._nuxt.dev ? '"development"' : '"production"', 'process.env.NODE_ENV': nitroContext._nuxt.dev ? '"development"' : '"production"',
'typeof window': '"undefined"', 'typeof window': '"undefined"',
'global.': 'globalThis.', ...Object.fromEntries([';', '(', '{', '}', ' ', '\t', '\n'].map(d => [`${d}global.`, `${d}globalThis.`])),
'process.server': 'true', 'process.server': 'true',
'process.client': 'false', 'process.client': 'false',
'process.env.NUXT_NO_SSR': JSON.stringify(!nitroContext._nuxt.ssr), 'process.env.NUXT_NO_SSR': JSON.stringify(!nitroContext._nuxt.ssr),