From dbf1275987d4d9724eab471f1600fba9a50aefb8 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Mon, 6 Jan 2025 15:52:37 +0100 Subject: [PATCH] fix: pass server island route to astro:build:done routes (#12907) --- .changeset/metal-phones-cross.md | 5 +++++ packages/astro/src/core/build/index.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/metal-phones-cross.md diff --git a/.changeset/metal-phones-cross.md b/.changeset/metal-phones-cross.md new file mode 100644 index 0000000000..d4e5f6f866 --- /dev/null +++ b/.changeset/metal-phones-cross.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes a regression around the server islands route, which was not passed to the adapters `astro:build:done` hook diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts index cc00172af5..5db6ff7586 100644 --- a/packages/astro/src/core/build/index.ts +++ b/packages/astro/src/core/build/index.ts @@ -29,6 +29,7 @@ import { collectPagesData } from './page-data.js'; import { staticBuild, viteBuild } from './static-build.js'; import type { StaticBuildOptions } from './types.js'; import { getTimeStat } from './util.js'; +import { getServerIslandRouteData } from '../server-islands/endpoint.js'; export interface BuildOptions { /** @@ -232,7 +233,8 @@ class AstroBuilder { pages: pageNames, routes: Object.values(allPages) .flat() - .map((pageData) => pageData.route), + .map((pageData) => pageData.route) + .concat(hasServerIslands ? getServerIslandRouteData(this.settings.config) : []), logging: this.logger, });