perf(web): optimize web Rsbuild and Tailwind build pipeline (#5786)
This commit is contained in:
Vendored
+5
-5
@@ -31,7 +31,6 @@
|
||||
"@hugeicons/react": "^1.1.6",
|
||||
"@lezer/highlight": "^1.2.3",
|
||||
"@lobehub/icons": "catalog:",
|
||||
"@tailwindcss/postcss": "^4.3.0",
|
||||
"@tanstack/react-query": "^5.100.14",
|
||||
"@tanstack/react-router": "^1.170.8",
|
||||
"@tanstack/react-table": "^8.21.3",
|
||||
@@ -57,9 +56,9 @@
|
||||
"nanoid": "^5.1.11",
|
||||
"next-themes": "^0.4.6",
|
||||
"qrcode.react": "catalog:",
|
||||
"react": "^19.2.6",
|
||||
"react": "catalog:",
|
||||
"react-day-picker": "^10.0.1",
|
||||
"react-dom": "^19.2.6",
|
||||
"react-dom": "catalog:",
|
||||
"react-hook-form": "^7.76.1",
|
||||
"react-i18next": "^17.0.8",
|
||||
"react-icons": "catalog:",
|
||||
@@ -80,8 +79,9 @@
|
||||
"zustand": "^5.0.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rsbuild/core": "^2.0.7",
|
||||
"@rsbuild/plugin-react": "^2.0.0",
|
||||
"@rsbuild/core": "catalog:",
|
||||
"@rsbuild/plugin-react": "catalog:",
|
||||
"@rsbuild/plugin-tailwindcss": "catalog:",
|
||||
"@tanstack/react-query-devtools": "^5.100.14",
|
||||
"@tanstack/react-router-devtools": "^1.167.0",
|
||||
"@tanstack/router-plugin": "^1.168.11",
|
||||
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
export default {
|
||||
plugins: {
|
||||
'@tailwindcss/postcss': {},
|
||||
},
|
||||
}
|
||||
Vendored
+3
-6
@@ -3,6 +3,7 @@ import { fileURLToPath } from 'node:url'
|
||||
|
||||
import { defineConfig, loadEnv } from '@rsbuild/core'
|
||||
import { pluginReact } from '@rsbuild/plugin-react'
|
||||
import { pluginTailwindcss } from '@rsbuild/plugin-tailwindcss'
|
||||
import { tanstackRouter } from '@tanstack/router-plugin/rspack'
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
@@ -23,7 +24,7 @@ export default defineConfig(({ envMode }) => {
|
||||
) as Record<string, { target: string; changeOrigin: boolean }>
|
||||
|
||||
return {
|
||||
plugins: [pluginReact()],
|
||||
plugins: [pluginReact(), pluginTailwindcss({ optimize: false })],
|
||||
// Rsbuild 2: replaces deprecated `performance.chunkSplit` (RSPack 2 aligned)
|
||||
splitChunks: {
|
||||
preset: 'default',
|
||||
@@ -83,11 +84,7 @@ export default defineConfig(({ envMode }) => {
|
||||
performance: {
|
||||
// Remove console in production
|
||||
removeConsole: isProd ? ['log'] : false,
|
||||
// Speed up repeated `rsbuild build` (local + CI when node_modules/.cache is preserved).
|
||||
// @see https://v2.rsbuild.dev/config/performance/build-cache
|
||||
buildCache: {
|
||||
cacheDigest: [process.env.VITE_REACT_APP_VERSION],
|
||||
},
|
||||
buildCache: false,
|
||||
},
|
||||
tools: {
|
||||
rspack: {
|
||||
|
||||
Reference in New Issue
Block a user