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
1
import {
2
defineIntegration,
3
createResolver,
4
watchIntegration
5
} from "astro-integration-kit";
6
7
export default defineIntegration({
8
// ...
9
setup() {
10
const { resolve } = createResolver(import.meta.url)
11
12
return {
13
"astro:config:setup": (params) => {
14
watchIntegration(params, resolve())
15
}
16
}
17
}
18
})