From cfab5cc6595a55ff071e4163f6ab32a40eeb4e09 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 4 Jun 2026 13:42:01 +0100 Subject: [PATCH] Iterate NODE_ENV --- modules/banner/element-web/vite.config.ts | 13 ++++++------- modules/opendesk/element-web/vite.config.ts | 13 ++++++------- .../restricted-guests/element-web/vite.config.ts | 13 ++++++------- modules/widget-toggles/element-web/vite.config.ts | 13 ++++++------- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/modules/banner/element-web/vite.config.ts b/modules/banner/element-web/vite.config.ts index ab331f6419..e2ee02eaa2 100644 --- a/modules/banner/element-web/vite.config.ts +++ b/modules/banner/element-web/vite.config.ts @@ -39,13 +39,6 @@ export default defineConfig({ react: "window.React", }, }, - transform: { - define: { - // Use production mode for the build as it is tested against production builds of Element Web, - // this is required for React JSX versions to be compatible. - "process.env.NODE_ENV": JSON.stringify("production"), - }, - }, }, }, plugins: [ @@ -60,4 +53,10 @@ export default defineConfig({ react: "window.React", }), ], + define: { + // Use production mode for the build as it is tested against production builds of Element Web, + // this is required for React JSX versions to be compatible. + "process.env.NODE_ENV": "'production'", + "process": { env: { NODE_ENV: "production" } }, + }, }); diff --git a/modules/opendesk/element-web/vite.config.ts b/modules/opendesk/element-web/vite.config.ts index 23a0515ef8..17dc4d055e 100644 --- a/modules/opendesk/element-web/vite.config.ts +++ b/modules/opendesk/element-web/vite.config.ts @@ -37,13 +37,6 @@ export default defineConfig({ react: "window.React", }, }, - transform: { - define: { - // Use production mode for the build as it is tested against production builds of Element Web, - // this is required for React JSX versions to be compatible. - "process.env.NODE_ENV": JSON.stringify("production"), - }, - }, }, minify: false, }, @@ -57,4 +50,10 @@ export default defineConfig({ react: "window.React", }), ], + define: { + // Use production mode for the build as it is tested against production builds of Element Web, + // this is required for React JSX versions to be compatible. + "process.env.NODE_ENV": "'production'", + "process": { env: { NODE_ENV: "production" } }, + }, }); diff --git a/modules/restricted-guests/element-web/vite.config.ts b/modules/restricted-guests/element-web/vite.config.ts index 048b48335f..9dfdb5dbed 100644 --- a/modules/restricted-guests/element-web/vite.config.ts +++ b/modules/restricted-guests/element-web/vite.config.ts @@ -38,13 +38,6 @@ export default defineConfig({ react: "window.React", }, }, - transform: { - define: { - // Use production mode for the build as it is tested against production builds of Element Web, - // this is required for React JSX versions to be compatible. - "process.env.NODE_ENV": JSON.stringify("production"), - }, - }, }, }, plugins: [ @@ -58,4 +51,10 @@ export default defineConfig({ react: "window.React", }), ], + define: { + // Use production mode for the build as it is tested against production builds of Element Web, + // this is required for React JSX versions to be compatible. + "process.env.NODE_ENV": "'production'", + "process": { env: { NODE_ENV: "production" } }, + }, }); diff --git a/modules/widget-toggles/element-web/vite.config.ts b/modules/widget-toggles/element-web/vite.config.ts index 51770551f9..dc8cc37107 100644 --- a/modules/widget-toggles/element-web/vite.config.ts +++ b/modules/widget-toggles/element-web/vite.config.ts @@ -39,13 +39,6 @@ export default defineConfig({ react: "window.React", }, }, - transform: { - define: { - // Use production mode for the build as it is tested against production builds of Element Web, - // this is required for React JSX versions to be compatible. - "process.env.NODE_ENV": JSON.stringify("production"), - }, - }, }, }, plugins: [ @@ -60,4 +53,10 @@ export default defineConfig({ react: "window.React", }), ], + define: { + // Use production mode for the build as it is tested against production builds of Element Web, + // this is required for React JSX versions to be compatible. + "process.env.NODE_ENV": "'production'", + "process": { env: { NODE_ENV: "production" } }, + }, });