From 194ff339754480a73f67cd88978c0c8c4aa8ee97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Fri, 25 Oct 2024 17:54:35 +0900 Subject: [PATCH] test: add compat code for vite v6 (#29677) --- test/basic.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/basic.test.ts b/test/basic.test.ts index 1c65baa6bb..d4039d31cd 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -2374,7 +2374,7 @@ describe('component islands', () => { "link": [], "style": [ { - "innerHTML": "pre[data-v-xxxxx]{color:blue}", + "innerHTML": "pre[data-v-xxxxx]{color:#00f}", }, ], } @@ -2743,7 +2743,11 @@ function normaliseIslandResult (result: NuxtIslandResponse) { for (const style of result.head.style) { if (typeof style !== 'string') { if (style.innerHTML) { - style.innerHTML = (style.innerHTML as string).replace(/data-v-[a-z0-9]+/g, 'data-v-xxxxx') + style.innerHTML = + (style.innerHTML as string) + .replace(/data-v-[a-z0-9]+/g, 'data-v-xxxxx') + // Vite 6 enables CSS minify by default for SSR + .replace(/blue/, '#00f') } if (style.key) { style.key = style.key.replace(/-[a-z0-9]+$/i, '')