Skip to content

Commit ae4ae99

Browse files
authored
chore: update @vitejs/plugin-react to 6.0.0 (pingdotgg#1002)
1 parent 36473f7 commit ae4ae99

4 files changed

Lines changed: 214 additions & 237 deletions

File tree

apps/web/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,20 @@
4242
},
4343
"devDependencies": {
4444
"@effect/language-service": "catalog:",
45+
"@rolldown/plugin-babel": "^0.2.0",
4546
"@tailwindcss/vite": "^4.0.0",
4647
"@tanstack/router-plugin": "^1.161.0",
48+
"@types/babel__core": "^7.20.5",
4749
"@types/react": "^19.0.0",
4850
"@types/react-dom": "^19.0.0",
49-
"@vitejs/plugin-react": "^5.1.4",
51+
"@vitejs/plugin-react": "^6.0.0",
5052
"@vitest/browser-playwright": "^4.0.18",
5153
"babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
5254
"msw": "^2.12.10",
5355
"playwright": "^1.58.2",
5456
"tailwindcss": "^4.0.0",
5557
"typescript": "catalog:",
56-
"vite": "^8.0.0-beta.12",
58+
"vite": "^8.0.0",
5759
"vitest": "catalog:",
5860
"vitest-browser-react": "^2.0.5"
5961
}

apps/web/vite.config.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import tailwindcss from "@tailwindcss/vite";
2-
import react from "@vitejs/plugin-react";
2+
import react, { reactCompilerPreset } from "@vitejs/plugin-react";
3+
import babel from "@rolldown/plugin-babel";
34
import { tanstackRouter } from "@tanstack/router-plugin/vite";
45
import { defineConfig } from "vite";
5-
import { version } from "./package.json" with { type: "json" };
6+
import pkg from "./package.json" with { type: "json" };
67

78
const port = Number(process.env.PORT ?? 5733);
89
const sourcemapEnv = process.env.T3CODE_WEB_SOURCEMAP?.trim().toLowerCase();
@@ -17,10 +18,14 @@ const buildSourcemap =
1718
export default defineConfig({
1819
plugins: [
1920
tanstackRouter(),
20-
react({
21-
babel: {
22-
plugins: [["babel-plugin-react-compiler", { target: "19" }]],
23-
},
21+
react(),
22+
babel({
23+
// We need to be explicit about the parser options after moving to @vitejs/plugin-react v6.0.0
24+
// This is because the babel plugin only automatically parses typescript and jsx based on relative paths (e.g. "**/*.ts")
25+
// whereas the previous version of the plugin parsed all files with a .ts extension.
26+
// This is causing our packages/ directory to fail to parse, as they are not relative to the CWD.
27+
parserOpts: { plugins: ["typescript", "jsx"] },
28+
presets: [reactCompilerPreset()],
2429
}),
2530
tailwindcss(),
2631
],
@@ -30,7 +35,7 @@ export default defineConfig({
3035
define: {
3136
// In dev mode, tell the web app where the WebSocket server lives
3237
"import.meta.env.VITE_WS_URL": JSON.stringify(process.env.VITE_WS_URL ?? ""),
33-
"import.meta.env.APP_VERSION": JSON.stringify(version),
38+
"import.meta.env.APP_VERSION": JSON.stringify(pkg.version),
3439
},
3540
resolve: {
3641
tsconfigPaths: true,

0 commit comments

Comments
 (0)