mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 14:45:15 +00:00
test: add compat code for vite v6 (#29677)
This commit is contained in:
parent
450d291b18
commit
194ff33975
@ -2374,7 +2374,7 @@ describe('component islands', () => {
|
|||||||
"link": [],
|
"link": [],
|
||||||
"style": [
|
"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) {
|
for (const style of result.head.style) {
|
||||||
if (typeof style !== 'string') {
|
if (typeof style !== 'string') {
|
||||||
if (style.innerHTML) {
|
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) {
|
if (style.key) {
|
||||||
style.key = style.key.replace(/-[a-z0-9]+$/i, '')
|
style.key = style.key.replace(/-[a-z0-9]+$/i, '')
|
||||||
|
Loading…
Reference in New Issue
Block a user