From c2aa9d79fffa54bc5432de2b339f733f62d5bac3 Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Tue, 7 Apr 2026 11:10:45 +0800 Subject: [PATCH] Revert "feat: add babel-plugin-react-compiler and configure Vite for optimized chunking" This reverts commit 1005baabe699251d91b3169843d043c515801642. --- package.json | 3 +-- pnpm-lock.yaml | 16 ++-------------- vite.config.mts | 33 +-------------------------------- 3 files changed, 4 insertions(+), 48 deletions(-) diff --git a/package.json b/package.json index d899d03e9..ef4d8001a 100644 --- a/package.json +++ b/package.json @@ -93,9 +93,8 @@ "@types/validator": "^13.15.10", "@vitejs/plugin-legacy": "^8.0.0", "@vitejs/plugin-react": "^6.0.1", - "adm-zip": "^0.5.16", "axios": "^1.13.6", - "babel-plugin-react-compiler": "^1.0.0", + "adm-zip": "^0.5.16", "cli-color": "^2.0.4", "commander": "^14.0.3", "cross-env": "^10.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 649d72130..bc3974380 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -179,16 +179,13 @@ importers: version: 8.0.1(terser@5.46.1)(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@24.12.0)(jiti@2.6.1)(sass@1.98.0)(terser@5.46.1)(yaml@2.8.3)) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(babel-plugin-react-compiler@1.0.0)(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@24.12.0)(jiti@2.6.1)(sass@1.98.0)(terser@5.46.1)(yaml@2.8.3)) + version: 6.0.1(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@24.12.0)(jiti@2.6.1)(sass@1.98.0)(terser@5.46.1)(yaml@2.8.3)) adm-zip: specifier: ^0.5.16 version: 0.5.16 axios: specifier: ^1.13.6 version: 1.14.0 - babel-plugin-react-compiler: - specifier: ^1.0.0 - version: 1.0.0 cli-color: specifier: ^2.0.4 version: 2.0.4 @@ -1985,9 +1982,6 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 - babel-plugin-react-compiler@1.0.0: - resolution: {integrity: sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==} - bail@2.0.2: resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} @@ -5442,12 +5436,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitejs/plugin-react@6.0.1(babel-plugin-react-compiler@1.0.0)(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@24.12.0)(jiti@2.6.1)(sass@1.98.0)(terser@5.46.1)(yaml@2.8.3))': + '@vitejs/plugin-react@6.0.1(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@24.12.0)(jiti@2.6.1)(sass@1.98.0)(terser@5.46.1)(yaml@2.8.3))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.7 vite: 8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@24.12.0)(jiti@2.6.1)(sass@1.98.0)(terser@5.46.1)(yaml@2.8.3) - optionalDependencies: - babel-plugin-react-compiler: 1.0.0 acorn-jsx@5.3.2(acorn@8.16.0): dependencies: @@ -5531,10 +5523,6 @@ snapshots: transitivePeerDependencies: - supports-color - babel-plugin-react-compiler@1.0.0: - dependencies: - '@babel/types': 7.29.0 - bail@2.0.2: {} balanced-match@4.0.4: {} diff --git a/vite.config.mts b/vite.config.mts index 75e05cdfb..1adc00dc5 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -10,11 +10,7 @@ export default defineConfig({ server: { port: 3000 }, plugins: [ svgr(), - react({ - babel: { - plugins: ['babel-plugin-react-compiler'], - }, - } as any), + react(), legacy({ modernTargets: ['edge>=109', 'safari>=14'], renderLegacyChunks: false, @@ -30,24 +26,6 @@ export default defineConfig({ outDir: '../dist', emptyOutDir: true, chunkSizeWarningLimit: 4000, - rollupOptions: { - output: { - manualChunks: (id) => { - if (id.includes('monaco-yaml')) return 'monaco-yaml' - if ( - id.includes('node_modules/react/') || - id.includes('node_modules/react-dom/') - ) - return 'react' - if (id.includes('node_modules/react-router')) return 'router' - if ( - id.includes('node_modules/i18next') || - id.includes('node_modules/react-i18next') - ) - return 'i18n' - }, - }, - }, }, resolve: { alias: { @@ -58,13 +36,4 @@ export default defineConfig({ define: { OS_PLATFORM: `"${process.platform}"`, }, - optimizeDeps: { - include: [ - 'react', - 'react-dom', - 'react-router-dom', - 'i18next', - 'react-i18next', - ], - }, })