mirror of
https://github.com/withastro/astro.git
synced 2025-03-17 23:11:29 -05:00
Use IE conditional comment placeholders for server island start markers (#12090)
These placeholders are much less likely to be removed by HTML minifiers, because they have traditionally been used to change the behavior of site.
This commit is contained in:
parent
11d447f66b
commit
d49a537f2a
2 changed files with 7 additions and 2 deletions
5
.changeset/rich-apes-divide.md
Normal file
5
.changeset/rich-apes-divide.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Server islands: changes the server island HTML placeholder comment so that it is much less likely to get removed by HTML minifiers.
|
|
@ -47,7 +47,7 @@ export function renderServerIsland(
|
|||
}
|
||||
}
|
||||
|
||||
destination.write('<!--server-island-start-->');
|
||||
destination.write('<!--[if astro]>server-island-start<![endif]-->');
|
||||
|
||||
// Render the slots
|
||||
const renderedSlots: Record<string, string> = {};
|
||||
|
@ -88,7 +88,7 @@ if(response.status === 200 && response.headers.get('content-type') === 'text/htm
|
|||
// Swap!
|
||||
while(script.previousSibling &&
|
||||
script.previousSibling.nodeType !== 8 &&
|
||||
script.previousSibling.data !== 'server-island-start') {
|
||||
script.previousSibling.data !== '[if astro]>server-island-start<![endif]') {
|
||||
script.previousSibling.remove();
|
||||
}
|
||||
script.previousSibling?.remove();
|
||||
|
|
Loading…
Add table
Reference in a new issue