From 5f3e67b5e7056fd6967fd9955cfffeec99998773 Mon Sep 17 00:00:00 2001 From: Mathijs Rutgers Date: Sat, 28 Mar 2026 11:58:54 +0100 Subject: [PATCH] Add react-compiler for optimization --- bun.lock | 3 +++ package.json | 1 + vite.config.ts | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bun.lock b/bun.lock index 213285e..876d58b 100644 --- a/bun.lock +++ b/bun.lock @@ -17,6 +17,7 @@ "@types/react-dom": "^19.1.2", "@vitejs/plugin-react": "^4.4.1", "autoprefixer": "^10.4.21", + "babel-plugin-react-compiler": "^1.0.0", "postcss": "^8.5.3", "tailwindcss": "^3.4.17", "typescript": "^5.8.3", @@ -491,6 +492,8 @@ "babel-plugin-polyfill-regenerator": ["babel-plugin-polyfill-regenerator@0.6.8", "", { "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.8" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-M762rNHfSF1EV3SLtnCJXFoQbbIIz0OyRwnCmV0KPC7qosSfCO0QLTSuJX3ayAebubhE6oYBAYPrBA5ljowaZg=="], + "babel-plugin-react-compiler": ["babel-plugin-react-compiler@1.0.0", "", { "dependencies": { "@babel/types": "^7.26.0" } }, "sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw=="], + "balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], "baseline-browser-mapping": ["baseline-browser-mapping@2.10.10", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-sUoJ3IMxx4AyRqO4MLeHlnGDkyXRoUG0/AI9fjK+vS72ekpV0yWVY7O0BVjmBcRtkNcsAO2QDZ4tdKKGoI6YaQ=="], diff --git a/package.json b/package.json index 4452196..ed96688 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@types/react-dom": "^19.1.2", "@vitejs/plugin-react": "^4.4.1", "autoprefixer": "^10.4.21", + "babel-plugin-react-compiler": "^1.0.0", "postcss": "^8.5.3", "tailwindcss": "^3.4.17", "typescript": "^5.8.3", diff --git a/vite.config.ts b/vite.config.ts index dec286b..db2ea0a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,7 +11,11 @@ export default defineConfig({ __COMMIT_HASH__: JSON.stringify(commitHash), }, plugins: [ - react(), + react({ + babel: { + plugins: ["babel-plugin-react-compiler"], + }, + }), VitePWA({ registerType: "autoUpdate", includeAssets: [