diff --git a/modules/banner/element-web/vite.config.ts b/modules/banner/element-web/vite.config.ts index d7ae139b11..f91b5b95e4 100644 --- a/modules/banner/element-web/vite.config.ts +++ b/modules/banner/element-web/vite.config.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. import { dirname, resolve } from "node:path"; import { fileURLToPath } from "node:url"; -import { defineConfig } from "vite"; +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"; @@ -27,8 +27,12 @@ export default defineConfig({ outDir: "lib", target: "esnext", sourcemap: true, - rollupOptions: { - external: ["react"], + rolldownOptions: { + plugins: [ + esmExternalRequirePlugin({ + external: ["react"], + }), + ], }, }, plugins: [ diff --git a/modules/opendesk/element-web/vite.config.ts b/modules/opendesk/element-web/vite.config.ts index 8f1d83e06f..b18db2791f 100644 --- a/modules/opendesk/element-web/vite.config.ts +++ b/modules/opendesk/element-web/vite.config.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. import { dirname, resolve } from "node:path"; import { fileURLToPath } from "node:url"; -import { defineConfig } from "vite"; +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"; @@ -25,8 +25,12 @@ export default defineConfig({ outDir: "lib", target: "esnext", sourcemap: true, - rollupOptions: { - external: ["react"], + rolldownOptions: { + plugins: [ + esmExternalRequirePlugin({ + external: ["react"], + }), + ], }, minify: false, }, diff --git a/modules/restricted-guests/element-web/vite.config.ts b/modules/restricted-guests/element-web/vite.config.ts index 24798ac03f..7c90bde5f7 100644 --- a/modules/restricted-guests/element-web/vite.config.ts +++ b/modules/restricted-guests/element-web/vite.config.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. import { dirname, resolve } from "node:path"; import { fileURLToPath } from "node:url"; -import { defineConfig } from "vite"; +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"; @@ -26,8 +26,12 @@ export default defineConfig({ outDir: "lib", target: "esnext", sourcemap: true, - rollupOptions: { - external: ["react"], + rolldownOptions: { + plugins: [ + esmExternalRequirePlugin({ + external: ["react"], + }), + ], }, }, plugins: [ diff --git a/modules/widget-toggles/element-web/vite.config.ts b/modules/widget-toggles/element-web/vite.config.ts index b65e3ec8ea..a0c42c6ee0 100644 --- a/modules/widget-toggles/element-web/vite.config.ts +++ b/modules/widget-toggles/element-web/vite.config.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. import { dirname, resolve } from "node:path"; import { fileURLToPath } from "node:url"; -import { defineConfig } from "vite"; +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"; @@ -27,8 +27,12 @@ export default defineConfig({ outDir: "lib", target: "esnext", sourcemap: true, - rollupOptions: { - external: ["react"], + rolldownOptions: { + plugins: [ + esmExternalRequirePlugin({ + external: ["react"], + }), + ], }, }, plugins: [