summaryrefslogtreecommitdiff
path: root/packages/astro/src/runtime/server/scripts.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro/src/runtime/server/scripts.ts')
-rw-r--r--packages/astro/src/runtime/server/scripts.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/astro/src/runtime/server/scripts.ts b/packages/astro/src/runtime/server/scripts.ts
index 2ab368625..76e0326e2 100644
--- a/packages/astro/src/runtime/server/scripts.ts
+++ b/packages/astro/src/runtime/server/scripts.ts
@@ -1,5 +1,6 @@
import type { SSRResult } from '../../@types/astro.js';
import islandScript from './astro-island.prebuilt.js';
+import islandScriptDev from './astro-island.prebuilt-dev.js';
const ISLAND_STYLES = `<style>astro-island,astro-slot,astro-static-slot{display:contents}</style>`;
@@ -36,10 +37,9 @@ export function getPrescripts(result: SSRResult, type: PrescriptType, directive:
// deps to be loaded immediately.
switch (type) {
case 'both':
- return `${ISLAND_STYLES}<script>${getDirectiveScriptText(
- result,
- directive
- )};${islandScript}</script>`;
+ return `${ISLAND_STYLES}<script>${getDirectiveScriptText(result, directive)};${
+ process.env.NODE_ENV === 'development' ? islandScriptDev : islandScript
+ }</script>`;
case 'directive':
return `<script>${getDirectiveScriptText(result, directive)}</script>`;
case null: