Revert "feat: add babel-plugin-react-compiler and configure Vite for optimized chunking"

This reverts commit 1005baabe699251d91b3169843d043c515801642.
This commit is contained in:
Tunglies 2026-04-07 11:10:45 +08:00
parent bff78d96b4
commit c2aa9d79ff
No known key found for this signature in database
GPG Key ID: B9B01B389469B3E8
3 changed files with 4 additions and 48 deletions

View File

@ -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",

16
pnpm-lock.yaml generated
View File

@ -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: {}

View File

@ -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',
],
},
})