Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[v6]: add docs for entryType in Adapter API
  • Loading branch information
ArmandPhilippot committed Dec 15, 2025
commit 9871a258da4d42451063c4d20833cdf12abd2a86
41 changes: 41 additions & 0 deletions src/content/docs/en/reference/adapter-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,47 @@ export default function createIntegration() {
}
```

### `entryType`

<p>

**Type:** `"legacy-dynamic" | "self"`<br />
**Default**: `"legacy-dynamic"`<br />
<Since v="6.0.0" />
</p>

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.
Expand Down