astro/.changeset/chilly-pants-fix.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
594 B
Markdown
Raw Normal View History

---
'astro': minor
---
Astro exposes the middleware file path to the integrations in the hook `astro:build:ssr`
```ts
// myIntegration.js
import type { AstroIntegration } from 'astro';
function integration(): AstroIntegration {
return {
name: "fancy-astro-integration",
hooks: {
'astro:build:ssr': ({ middlewareEntryPoint }) => {
if (middlewareEntryPoint) {
// do some operations
}
}
}
}
}
```
The `middlewareEntryPoint` is only defined if the user has created an Astro middleware.