From c91b26e85d98edc639054c88d4d95af3003f597f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Mon, 19 Feb 2024 13:38:05 +0100 Subject: [PATCH] fix(vite): production build uses development variables Vite bundles for production when `NODE_ENV=production`, which makes variables like `import.meta.env.DEV` equal to `true` even for production environments. --- vite/vite.cjs | 1 + 1 file changed, 1 insertion(+) diff --git a/vite/vite.cjs b/vite/vite.cjs index e484b26f..fdb041e7 100644 --- a/vite/vite.cjs +++ b/vite/vite.cjs @@ -16,6 +16,7 @@ exports.build = (options) => { env: { HOME: options.homeEnv, PATH: options.pathEnv, + NODE_ENV: "production", }, }); const output = buffer.stdout.toString().split("\n");