Skip to content

watchIntegration

In development, watchIntegration will reload the Astro dev server if any files within the integration directory has changed. For example:

my-integration/index.ts
import { createResolver, defineIntegration } from "astro-integration-kit";
import { watchIntegrationPlugin } from "astro-integration-kit/plugins";
export default defineIntegration({
name: "my-integration",
plugins: [watchIntegrationPlugin],
setup() {
const { resolve } = createResolver(import.meta.url);
return {
"astro:config:setup": ({ watchIntegration }) => {
watchIntegration(resolve())
}
}
}
})