9e5fafa2b2
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
594 B
594 B
astro |
---|
minor |
Astro exposes the middleware file path to the integrations in the hook astro:build:ssr
// 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.