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" } }, + }, });