From c90d385a74dc87f5323101752bdf4a917e5d00a4 Mon Sep 17 00:00:00 2001 From: jserfeng <1114550440@qq.com> Date: Thu, 4 Sep 2025 10:42:02 +0800 Subject: [PATCH] feat: use special cacheGroups to handle vanilla extract modules --- rsbuild/vanilla-extract/rsbuild.config.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rsbuild/vanilla-extract/rsbuild.config.ts b/rsbuild/vanilla-extract/rsbuild.config.ts index c13640f1c..f7f9bd189 100644 --- a/rsbuild/vanilla-extract/rsbuild.config.ts +++ b/rsbuild/vanilla-extract/rsbuild.config.ts @@ -10,6 +10,21 @@ export default defineConfig({ }, }), ], + performance: { + chunkSplit: { + override: { + cacheGroups: { + vanillaCss: { + minSize: 0, + chunks: 'all', + test: /@vanilla-extract\/webpack-plugin/, + priority: 1000, + name: process.env.NODE_ENV === 'development' && 'vanilla-extract', + }, + }, + }, + }, + }, tools: { rspack: { plugins: [new VanillaExtractPlugin()],