From 9871a258da4d42451063c4d20833cdf12abd2a86 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 15 Dec 2025 16:24:57 +0100 Subject: [PATCH 1/2] [v6]: add docs for `entryType` in Adapter API --- .../docs/en/reference/adapter-reference.mdx | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/content/docs/en/reference/adapter-reference.mdx b/src/content/docs/en/reference/adapter-reference.mdx index b600051a873c9..1e1d71ab2e974 100644 --- a/src/content/docs/en/reference/adapter-reference.mdx +++ b/src/content/docs/en/reference/adapter-reference.mdx @@ -246,6 +246,47 @@ export default function createIntegration() { } ``` +### `entryType` + +

+ +**Type:** `"legacy-dynamic" | "self"`
+**Default**: `"legacy-dynamic"`
+ +

+ +Determines how the adapter's entrypoint is handled during the build. By default, Astro will build one and no additional configuration is required. You can provide your own entrypoint with `"self"` and by setting [`rollupOptions.input`](https://rollupjs.org/configuration-options/#input) with your entrypoint path. + +The following example defines the `entryType` and Rollup options to tell Astro that a custom entrypoint is provided: + +```js title="my-adapter.mjs" {9-11,20} +export default function createIntegration() { + return { + name: '@example/my-adapter', + hooks: { + 'astro:config:setup': ({ updateConfig }) => { + updateConfig({ + vite: { + build: { + rollupOptions: { + input: "@example/my-adapter/custom-entrypoint.js" + } + } + } + }) + }, + 'astro:config:done': ({ setAdapter }) => { + setAdapter({ + name: '@example/my-adapter', + serverEntrypoint: '@example/my-adapter/server.js', + entryType: "self", + }); + }, + }, + }; +} +``` + ## Building a server entrypoint You will need to create a file that executes during server-side requests to enable on-demand rendering with your particular host. Astro's adapter API attempts to work with any type of host and gives a flexible way to conform to the host APIs. From 931cf14bce54254a316858d03d462f83fa04aea5 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 15 Dec 2025 16:45:49 +0100 Subject: [PATCH 2/2] always better with Sarah! Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> --- src/content/docs/en/reference/adapter-reference.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/content/docs/en/reference/adapter-reference.mdx b/src/content/docs/en/reference/adapter-reference.mdx index 1e1d71ab2e974..0cda680a36e3a 100644 --- a/src/content/docs/en/reference/adapter-reference.mdx +++ b/src/content/docs/en/reference/adapter-reference.mdx @@ -255,7 +255,9 @@ export default function createIntegration() {

-Determines how the adapter's entrypoint is handled during the build. By default, Astro will build one and no additional configuration is required. You can provide your own entrypoint with `"self"` and by setting [`rollupOptions.input`](https://rollupjs.org/configuration-options/#input) with your entrypoint path. +Specifies whether the adapter's entrypoint is automatically created by Astro (default), or whether a custom entrypoint is used. + +To provide your own entrypoint, configure `entryType: "self"` and set [`rollupOptions.input`](https://rollupjs.org/configuration-options/#input) with your custom entrypoint path. The following example defines the `entryType` and Rollup options to tell Astro that a custom entrypoint is provided: