diff --git a/modules/banner/element-web/package.json b/modules/banner/element-web/package.json index c9a36d3b84..a2af841d74 100644 --- a/modules/banner/element-web/package.json +++ b/modules/banner/element-web/package.json @@ -21,7 +21,6 @@ "matrix-web-i18n": "^3.6.0", "matrix-widget-api": "^1.17.0", "react": "19.2.6", - "rollup-plugin-external-globals": "^0.13.0", "typescript": "^6.0.0", "vite": "^8.0.0", "vite-plugin-node-polyfills": "^0.28.0", diff --git a/modules/banner/element-web/vite.config.ts b/modules/banner/element-web/vite.config.ts index f91b5b95e4..6aa89587be 100644 --- a/modules/banner/element-web/vite.config.ts +++ b/modules/banner/element-web/vite.config.ts @@ -10,7 +10,6 @@ import { fileURLToPath } from "node:url"; import { defineConfig, esmExternalRequirePlugin } from "vite"; import react from "@vitejs/plugin-react"; import { nodePolyfills } from "vite-plugin-node-polyfills"; -import externalGlobals from "rollup-plugin-external-globals"; import svgr from "vite-plugin-svgr"; import { importCSSSheet } from "@arcmantle/vite-plugin-import-css-sheet"; @@ -33,6 +32,12 @@ export default defineConfig({ external: ["react"], }), ], + output: { + globals: { + // Reuse React from the host app + react: "window.React", + }, + }, }, }, plugins: [ @@ -42,10 +47,6 @@ export default defineConfig({ nodePolyfills({ include: ["events"], }), - externalGlobals({ - // Reuse React from the host app - react: "window.React", - }), ], define: { // Use production mode for the build as it is tested against production builds of Element Web, diff --git a/modules/opendesk/element-web/package.json b/modules/opendesk/element-web/package.json index c69700b632..70814d9062 100644 --- a/modules/opendesk/element-web/package.json +++ b/modules/opendesk/element-web/package.json @@ -24,7 +24,6 @@ "@vitejs/plugin-react": "^5.0.0", "react": "19.2.6", "react-dom": "19.2.6", - "rollup-plugin-external-globals": "^0.13.0", "typescript": "^6.0.0", "vite": "^8.0.0", "vite-plugin-node-polyfills": "^0.28.0" diff --git a/modules/opendesk/element-web/vite.config.ts b/modules/opendesk/element-web/vite.config.ts index b18db2791f..4a9353fb03 100644 --- a/modules/opendesk/element-web/vite.config.ts +++ b/modules/opendesk/element-web/vite.config.ts @@ -10,7 +10,6 @@ import { fileURLToPath } from "node:url"; import { defineConfig, esmExternalRequirePlugin } from "vite"; import react from "@vitejs/plugin-react"; import { nodePolyfills } from "vite-plugin-node-polyfills"; -import externalGlobals from "rollup-plugin-external-globals"; const __dirname = dirname(fileURLToPath(import.meta.url)); @@ -31,6 +30,12 @@ export default defineConfig({ external: ["react"], }), ], + output: { + globals: { + // Reuse React from the host app + react: "window.React", + }, + }, }, minify: false, }, @@ -39,10 +44,6 @@ export default defineConfig({ nodePolyfills({ include: ["events"], }), - externalGlobals({ - // Reuse React from the host app - react: "window.React", - }), ], define: { // Use production mode for the build as it is tested against production builds of Element Web, diff --git a/modules/restricted-guests/element-web/package.json b/modules/restricted-guests/element-web/package.json index 70d9b16709..b014f82147 100644 --- a/modules/restricted-guests/element-web/package.json +++ b/modules/restricted-guests/element-web/package.json @@ -18,7 +18,6 @@ "@types/react": "^19", "@vitejs/plugin-react": "^5.0.0", "react": "19.2.6", - "rollup-plugin-external-globals": "^0.13.0", "typescript": "^6.0.0", "vite": "^8.0.0", "vite-plugin-node-polyfills": "^0.28.0" diff --git a/modules/restricted-guests/element-web/vite.config.ts b/modules/restricted-guests/element-web/vite.config.ts index 7c90bde5f7..4517c4584c 100644 --- a/modules/restricted-guests/element-web/vite.config.ts +++ b/modules/restricted-guests/element-web/vite.config.ts @@ -10,7 +10,6 @@ import { fileURLToPath } from "node:url"; import { defineConfig, esmExternalRequirePlugin } from "vite"; import react from "@vitejs/plugin-react"; import { nodePolyfills } from "vite-plugin-node-polyfills"; -import externalGlobals from "rollup-plugin-external-globals"; import { importCSSSheet } from "@arcmantle/vite-plugin-import-css-sheet"; const __dirname = dirname(fileURLToPath(import.meta.url)); @@ -32,6 +31,12 @@ export default defineConfig({ external: ["react"], }), ], + output: { + globals: { + // Reuse React from the host app + react: "window.React", + }, + }, }, }, plugins: [ @@ -40,10 +45,6 @@ export default defineConfig({ nodePolyfills({ include: ["events"], }), - externalGlobals({ - // Reuse React from the host app - react: "window.React", - }), ], define: { // Use production mode for the build as it is tested against production builds of Element Web, diff --git a/modules/widget-toggles/element-web/package.json b/modules/widget-toggles/element-web/package.json index 1fb7b28dd3..38e6b87177 100644 --- a/modules/widget-toggles/element-web/package.json +++ b/modules/widget-toggles/element-web/package.json @@ -23,7 +23,6 @@ "@vitest/browser-playwright": "^4.0.0", "@vitest/coverage-v8": "^4.0.0", "react": "^19", - "rollup-plugin-external-globals": "^0.13.0", "typescript": "^6.0.0", "vite": "^8.0.0", "vite-plugin-node-polyfills": "^0.28.0", diff --git a/modules/widget-toggles/element-web/vite.config.ts b/modules/widget-toggles/element-web/vite.config.ts index a0c42c6ee0..f50e35e54d 100644 --- a/modules/widget-toggles/element-web/vite.config.ts +++ b/modules/widget-toggles/element-web/vite.config.ts @@ -10,7 +10,6 @@ import { fileURLToPath } from "node:url"; import { defineConfig, esmExternalRequirePlugin } from "vite"; import react from "@vitejs/plugin-react"; import { nodePolyfills } from "vite-plugin-node-polyfills"; -import externalGlobals from "rollup-plugin-external-globals"; import svgr from "vite-plugin-svgr"; import { importCSSSheet } from "@arcmantle/vite-plugin-import-css-sheet"; @@ -33,6 +32,12 @@ export default defineConfig({ external: ["react"], }), ], + output: { + globals: { + // Reuse React from the host app + react: "window.React", + }, + }, }, }, plugins: [ @@ -42,10 +47,6 @@ export default defineConfig({ nodePolyfills({ include: ["events"], }), - externalGlobals({ - // Reuse React from the host app - react: "window.React", - }), ], define: { // Use production mode for the build as it is tested against production builds of Element Web,