From 47dd8635e0c7c5f46e4bf132a8de5fd08692fd6f Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Thu, 26 Oct 2023 17:53:41 +0800 Subject: [PATCH 1/2] feat: disable css var hydration --- src/extractStyle.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/extractStyle.ts b/src/extractStyle.ts index dd2b0fe..871a0c6 100644 --- a/src/extractStyle.ts +++ b/src/extractStyle.ts @@ -57,7 +57,9 @@ export default function extractStyle(cache: Cache, plain = false) { return null; } const [order, styleId, styleStr] = extractedStyle; - cachePathMap[cachePath] = styleId; + if (key.startsWith('style')) { + cachePathMap[cachePath] = styleId; + } return [order, styleStr]; }) .filter(isNotNull) From 8561f161d3549d2187a8ee8d20f542cb823c1bb9 Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Thu, 26 Oct 2023 17:58:46 +0800 Subject: [PATCH 2/2] chore: update snapshot --- tests/__snapshots__/css-variables.spec.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__snapshots__/css-variables.spec.tsx.snap b/tests/__snapshots__/css-variables.spec.tsx.snap index 55a0075..365a9e3 100644 --- a/tests/__snapshots__/css-variables.spec.tsx.snap +++ b/tests/__snapshots__/css-variables.spec.tsx.snap @@ -1,3 +1,3 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`CSS Variables > support ssr 1`] = `""`; +exports[`CSS Variables > support ssr 1`] = `""`;