chore(nitro): provide process.client and process.server

They should be handled in vite/webpack step but just in case
This commit is contained in:
Pooya Parsa 2021-06-14 20:37:35 +02:00
parent eee45396d1
commit b6104c6e83

View File

@ -132,6 +132,8 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
'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.', 'global.': 'globalThis.',
'process.server': 'true',
'process.client': 'false',
'process.env.ROUTER_BASE': JSON.stringify(nitroContext._nuxt.routerBase), 'process.env.ROUTER_BASE': JSON.stringify(nitroContext._nuxt.routerBase),
'process.env.PUBLIC_PATH': JSON.stringify(nitroContext._nuxt.publicPath), 'process.env.PUBLIC_PATH': JSON.stringify(nitroContext._nuxt.publicPath),
'process.env.NUXT_STATIC_BASE': JSON.stringify(nitroContext._nuxt.staticAssets.base), 'process.env.NUXT_STATIC_BASE': JSON.stringify(nitroContext._nuxt.staticAssets.base),