From e27a0173e8a656d8d75c70a580e3145a66f547b1 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 17 Jan 2022 10:44:56 +0000 Subject: [PATCH] fix(bridge): add missing process flags for vite (#2736) --- packages/bridge/src/vite/vite.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/bridge/src/vite/vite.ts b/packages/bridge/src/vite/vite.ts index 3f5747d9fc..4b614e1a57 100644 --- a/packages/bridge/src/vite/vite.ts +++ b/packages/bridge/src/vite/vite.ts @@ -26,6 +26,10 @@ async function bundle (nuxt: Nuxt, builder: any) { mode: nuxt.options.dev ? 'development' : 'production', logLevel: 'warn', define: { + 'process.static': nuxt.options.target === 'static', + 'process.env.NODE_ENV': JSON.stringify(nuxt.options.dev ? 'development' : 'production'), + 'process.mode': JSON.stringify(nuxt.options.dev ? 'development' : 'production'), + 'process.target': JSON.stringify(nuxt.options.target), 'process.dev': nuxt.options.dev }, resolve: {