This reverts commit 8d361169b8
.
This commit is contained in:
parent
4e1e8dc5c6
commit
da00425a5f
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
import type { SSRResult } from '../../@types/astro.js';
|
import type { SSRResult } from '../../@types/astro.js';
|
||||||
import islandScript from './astro-island.prebuilt.js';
|
import islandScript from './astro-island.prebuilt.js';
|
||||||
|
|
||||||
const ISLAND_STYLES = `<style style="display:none">astro-island,astro-slot,astro-static-slot{display:contents}</style>`;
|
const ISLAND_STYLES = `<style>astro-island,astro-slot,astro-static-slot{display:contents}</style>`;
|
||||||
|
|
||||||
export function determineIfNeedsHydrationScript(result: SSRResult): boolean {
|
export function determineIfNeedsHydrationScript(result: SSRResult): boolean {
|
||||||
if (result._metadata.hasHydrationScript) {
|
if (result._metadata.hasHydrationScript) {
|
||||||
|
@ -36,12 +36,12 @@ export function getPrescripts(result: SSRResult, type: PrescriptType, directive:
|
||||||
// deps to be loaded immediately.
|
// deps to be loaded immediately.
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'both':
|
case 'both':
|
||||||
return `${ISLAND_STYLES}<script style="display:none">${getDirectiveScriptText(
|
return `${ISLAND_STYLES}<script>${getDirectiveScriptText(
|
||||||
result,
|
result,
|
||||||
directive
|
directive
|
||||||
)};${islandScript}</script>`;
|
)};${islandScript}</script>`;
|
||||||
case 'directive':
|
case 'directive':
|
||||||
return `<script style="display:none">${getDirectiveScriptText(result, directive)}</script>`;
|
return `<script>${getDirectiveScriptText(result, directive)}</script>`;
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue