Commit 95e8c5ee by QuentinHsu Committed by GitHub

perf(web): optimize web Rsbuild and Tailwind build pipeline (#5786)

parent 52858ad1
......@@ -23,8 +23,8 @@
"marked": "^4.1.1",
"mermaid": "^11.6.0",
"qrcode.react": "catalog:",
"react": "^19.2.6",
"react-dom": "^19.2.6",
"react": "catalog:",
"react-dom": "catalog:",
"react-dropzone": "^14.2.3",
"react-fireworks": "^1.0.4",
"react-i18next": "^13.0.0",
......@@ -75,8 +75,8 @@
]
},
"devDependencies": {
"@rsbuild/core": "^2.0.7",
"@rsbuild/plugin-react": "^2.0.0",
"@rsbuild/core": "catalog:",
"@rsbuild/plugin-react": "catalog:",
"@so1ve/prettier-config": "^3.1.0",
"autoprefixer": "^10.4.21",
"eslint": "8.57.0",
......
......@@ -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",
......
export default {
plugins: {
'@tailwindcss/postcss': {},
},
}
......@@ -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: {
......
......@@ -7,6 +7,9 @@
],
"catalog": {
"@lobehub/icons": "^5.10.0",
"@rsbuild/core": "^2.1.1",
"@rsbuild/plugin-react": "^2.1.0",
"@rsbuild/plugin-tailwindcss": "^2.0.3",
"axios": "^1.16.1",
"clsx": "^2.1.1",
"dayjs": "^1.11.20",
......@@ -14,6 +17,8 @@
"oxlint": "^1.69.0",
"prettier": "^3.8.3",
"qrcode.react": "^4.2.0",
"react": "^19.2.6",
"react-dom": "^19.2.6",
"react-icons": "^5.6.0",
"react-markdown": "^10.1.0",
"remark-gfm": "^4.0.1",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment