Skip to content

addVitePlugin

addVitePlugin allows you add a vite plugin to the Astro config. For example:

my-integration/index.ts
1
import {
2
defineIntegration,
3
addVitePlugin
4
} from "astro-integration-kit";
5
import { VitePWA } from 'vite-plugin-pwa'
6
7
export default defineIntegration({
8
// ...
9
setup() {
10
return {
11
"astro:config:setup": (params) => {
12
addVitePlugin(params, {
13
plugin: VitePWA({ registerType: 'autoUpdate' })
14
})
15
}
16
}
17
}
18
})