diff --git a/modules/banner/element-web/vite.config.ts b/modules/banner/element-web/vite.config.ts index 6aa89587be..5556992672 100644 --- a/modules/banner/element-web/vite.config.ts +++ b/modules/banner/element-web/vite.config.ts @@ -38,6 +38,13 @@ 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: [ @@ -48,9 +55,4 @@ export default defineConfig({ include: ["events"], }), ], - 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" } }, - }, }); diff --git a/modules/opendesk/element-web/vite.config.ts b/modules/opendesk/element-web/vite.config.ts index 4a9353fb03..d55959680e 100644 --- a/modules/opendesk/element-web/vite.config.ts +++ b/modules/opendesk/element-web/vite.config.ts @@ -36,6 +36,13 @@ 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, }, @@ -45,9 +52,4 @@ export default defineConfig({ include: ["events"], }), ], - 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" } }, - }, }); diff --git a/modules/restricted-guests/element-web/vite.config.ts b/modules/restricted-guests/element-web/vite.config.ts index 4517c4584c..95a5175ae3 100644 --- a/modules/restricted-guests/element-web/vite.config.ts +++ b/modules/restricted-guests/element-web/vite.config.ts @@ -37,6 +37,13 @@ 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: [ @@ -46,9 +53,4 @@ export default defineConfig({ include: ["events"], }), ], - 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" } }, - }, }); diff --git a/modules/widget-toggles/element-web/vite.config.ts b/modules/widget-toggles/element-web/vite.config.ts index f50e35e54d..0e28cdffd8 100644 --- a/modules/widget-toggles/element-web/vite.config.ts +++ b/modules/widget-toggles/element-web/vite.config.ts @@ -38,6 +38,13 @@ 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: [ @@ -48,9 +55,4 @@ export default defineConfig({ include: ["events"], }), ], - 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" } }, - }, });