From 084471ce094334049533c418921a5ab06bd186e4 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 814377eb7c..05039dd26f 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -2377,7 +2377,7 @@ describe('component islands', () => { "link": [], "style": [ { - "innerHTML": "pre[data-v-xxxxx]{color:blue}", + "innerHTML": "pre[data-v-xxxxx]{color:#00f}", }, ], } @@ -2746,7 +2746,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, '')