Skip to content

addVitePlugin

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

my-integration/index.ts
import { defineIntegration } from "astro-integration-kit";
import { addVitePluginPlugin } from "astro-integration-kit/plugins";
import { VitePWA } from 'vite-plugin-pwa'
export default defineIntegration({
name: "my-integration",
plugins: [addVitePluginPlugin],
setup(options) {
return {
"astro:config:setup": ({ addVitePlugin }) => {
addVitePlugin(VitePWA({ registerType: 'autoUpdate' }))
}
}
}
})