Skip to content

Commit f7d2b62

Browse files
authored
Merge pull request #243 from element-hq/renovate/major-vite
Update vite (major)
2 parents 5cd482c + 9df32a0 commit f7d2b62

12 files changed

Lines changed: 306 additions & 402 deletions

File tree

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ coverage/
150150
**/test-results
151151
**/_results
152152
# Only commit snapshots from Linux
153-
**/tests/snapshots/**/*.png
154-
**/tests/snapshots/**/*.yml
155-
!**/tests/snapshots/**/*-linux.png
156-
!**/tests/snapshots/**/*-linux.aria.yml
153+
**/e2e/snapshots/**/*.png
154+
**/e2e/snapshots/**/*.yml
155+
!**/e2e/snapshots/**/*-linux.png
156+
!**/e2e/snapshots/**/*-linux.aria.yml
157157
/playwright-report/
158158
.DS_Store

modules/banner/element-web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"react": "19.2.6",
2424
"rollup-plugin-external-globals": "^0.13.0",
2525
"typescript": "^6.0.0",
26-
"vite": "^7.3.2",
26+
"vite": "^8.0.0",
2727
"vite-plugin-node-polyfills": "^0.28.0",
28-
"vite-plugin-svgr": "^4.3.0"
28+
"vite-plugin-svgr": "^5.0.0"
2929
},
3030
"dependencies": {
3131
"@radix-ui/react-dialog": "^1.1.6",

modules/banner/element-web/vite.config.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
77

88
import { dirname, resolve } from "node:path";
99
import { fileURLToPath } from "node:url";
10-
import { defineConfig } from "vite";
10+
import { defineConfig, esmExternalRequirePlugin } from "vite";
1111
import react from "@vitejs/plugin-react";
1212
import { nodePolyfills } from "vite-plugin-node-polyfills";
1313
import externalGlobals from "rollup-plugin-external-globals";
@@ -27,8 +27,18 @@ export default defineConfig({
2727
outDir: "lib",
2828
target: "esnext",
2929
sourcemap: true,
30-
rollupOptions: {
31-
external: ["react"],
30+
rolldownOptions: {
31+
plugins: [
32+
esmExternalRequirePlugin({
33+
external: ["react"],
34+
}),
35+
],
36+
output: {
37+
globals: {
38+
// Reuse React from the host app
39+
react: "window.React",
40+
},
41+
},
3242
},
3343
},
3444
plugins: [
@@ -46,6 +56,7 @@ export default defineConfig({
4656
define: {
4757
// Use production mode for the build as it is tested against production builds of Element Web,
4858
// this is required for React JSX versions to be compatible.
49-
process: { env: { NODE_ENV: "production" } },
59+
"process.env.NODE_ENV": "'production'",
60+
"process": { env: { NODE_ENV: "production" } },
5061
},
5162
});

modules/opendesk/element-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"react-dom": "19.2.6",
2727
"rollup-plugin-external-globals": "^0.13.0",
2828
"typescript": "^6.0.0",
29-
"vite": "^7.3.2",
29+
"vite": "^8.0.0",
3030
"vite-plugin-node-polyfills": "^0.28.0"
3131
}
3232
}

modules/opendesk/element-web/vite.config.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
77

88
import { dirname, resolve } from "node:path";
99
import { fileURLToPath } from "node:url";
10-
import { defineConfig } from "vite";
10+
import { defineConfig, esmExternalRequirePlugin } from "vite";
1111
import react from "@vitejs/plugin-react";
1212
import { nodePolyfills } from "vite-plugin-node-polyfills";
1313
import externalGlobals from "rollup-plugin-external-globals";
@@ -25,8 +25,18 @@ export default defineConfig({
2525
outDir: "lib",
2626
target: "esnext",
2727
sourcemap: true,
28-
rollupOptions: {
29-
external: ["react"],
28+
rolldownOptions: {
29+
plugins: [
30+
esmExternalRequirePlugin({
31+
external: ["react"],
32+
}),
33+
],
34+
output: {
35+
globals: {
36+
// Reuse React from the host app
37+
react: "window.React",
38+
},
39+
},
3040
},
3141
minify: false,
3242
},
@@ -43,6 +53,7 @@ export default defineConfig({
4353
define: {
4454
// Use production mode for the build as it is tested against production builds of Element Web,
4555
// this is required for React JSX versions to be compatible.
46-
process: { env: { NODE_ENV: "production" } },
56+
"process.env.NODE_ENV": "'production'",
57+
"process": { env: { NODE_ENV: "production" } },
4758
},
4859
});

modules/restricted-guests/element-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"react": "19.2.6",
2121
"rollup-plugin-external-globals": "^0.13.0",
2222
"typescript": "^6.0.0",
23-
"vite": "^7.3.2",
23+
"vite": "^8.0.0",
2424
"vite-plugin-node-polyfills": "^0.28.0"
2525
},
2626
"dependencies": {

modules/restricted-guests/element-web/vite.config.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
77

88
import { dirname, resolve } from "node:path";
99
import { fileURLToPath } from "node:url";
10-
import { defineConfig } from "vite";
10+
import { defineConfig, esmExternalRequirePlugin } from "vite";
1111
import react from "@vitejs/plugin-react";
1212
import { nodePolyfills } from "vite-plugin-node-polyfills";
1313
import externalGlobals from "rollup-plugin-external-globals";
@@ -26,8 +26,18 @@ export default defineConfig({
2626
outDir: "lib",
2727
target: "esnext",
2828
sourcemap: true,
29-
rollupOptions: {
30-
external: ["react"],
29+
rolldownOptions: {
30+
plugins: [
31+
esmExternalRequirePlugin({
32+
external: ["react"],
33+
}),
34+
],
35+
output: {
36+
globals: {
37+
// Reuse React from the host app
38+
react: "window.React",
39+
},
40+
},
3141
},
3242
},
3343
plugins: [
@@ -44,6 +54,7 @@ export default defineConfig({
4454
define: {
4555
// Use production mode for the build as it is tested against production builds of Element Web,
4656
// this is required for React JSX versions to be compatible.
47-
process: { env: { NODE_ENV: "production" } },
57+
"process.env.NODE_ENV": "'production'",
58+
"process": { env: { NODE_ENV: "production" } },
4859
},
4960
});

modules/widget-lifecycle/element-web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"@types/node": "^22.10.7",
1717
"@vitest/coverage-v8": "^4.0.0",
1818
"typescript": "^6.0.0",
19-
"vite": "^7.3.2",
19+
"vite": "^8.0.0",
2020
"vitest": "^4.0.0",
21-
"vitest-sonar-reporter": "^2.0.0"
21+
"vitest-sonar-reporter": "^3.0.0"
2222
},
2323
"dependencies": {
2424
"zod": "^4.0.0"

modules/widget-toggles/element-web/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"@vitest/browser-playwright": "^4.0.0",
2424
"@vitest/coverage-v8": "^4.0.0",
2525
"react": "^19",
26-
"rollup-plugin-external-globals": "^0.13.0",
2726
"typescript": "^6.0.0",
28-
"vite": "^7.1.11",
27+
"rollup-plugin-external-globals": "^0.13.0",
28+
"vite": "^8.0.0",
2929
"vite-plugin-node-polyfills": "^0.28.0",
30-
"vite-plugin-svgr": "^4.3.0",
30+
"vite-plugin-svgr": "^5.0.0",
3131
"vitest": "^4.0.0",
32-
"vitest-sonar-reporter": "^2.0.0"
32+
"vitest-sonar-reporter": "^3.0.0"
3333
},
3434
"dependencies": {
3535
"@vector-im/compound-design-tokens": "^10.0.0",

modules/widget-toggles/element-web/vite.config.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
77

88
import { dirname, resolve } from "node:path";
99
import { fileURLToPath } from "node:url";
10-
import { defineConfig } from "vite";
10+
import { defineConfig, esmExternalRequirePlugin } from "vite";
1111
import react from "@vitejs/plugin-react";
1212
import { nodePolyfills } from "vite-plugin-node-polyfills";
1313
import externalGlobals from "rollup-plugin-external-globals";
@@ -27,8 +27,18 @@ export default defineConfig({
2727
outDir: "lib",
2828
target: "esnext",
2929
sourcemap: true,
30-
rollupOptions: {
31-
external: ["react"],
30+
rolldownOptions: {
31+
plugins: [
32+
esmExternalRequirePlugin({
33+
external: ["react"],
34+
}),
35+
],
36+
output: {
37+
globals: {
38+
// Reuse React from the host app
39+
react: "window.React",
40+
},
41+
},
3242
},
3343
},
3444
plugins: [
@@ -46,6 +56,7 @@ export default defineConfig({
4656
define: {
4757
// Use production mode for the build as it is tested against production builds of Element Web,
4858
// this is required for React JSX versions to be compatible.
49-
process: { env: { NODE_ENV: "production" } },
59+
"process.env.NODE_ENV": "'production'",
60+
"process": { env: { NODE_ENV: "production" } },
5061
},
5162
});

0 commit comments

Comments
 (0)