Skip to content
Merged
Changes from all commits
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
43 changes: 43 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,49 @@ export default function createIntegration() {
}
```

### `entryType`

<p>

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

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:

```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