Skip to content

Commit 29703a8

Browse files
committed
✨ Add VitePWA plugin to auto generate service worker
1 parent 11a22bf commit 29703a8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

vite.config.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
import { defineConfig } from 'vite'
2-
import react from '@vitejs/plugin-react'
1+
import react from "@vitejs/plugin-react";
2+
import { defineConfig } from "vite";
3+
import { VitePWA } from "vite-plugin-pwa";
34

45
// https://vitejs.dev/config/
56
export default defineConfig({
6-
plugins: [react()]
7-
})
7+
plugins: [
8+
react(),
9+
VitePWA({
10+
registerType: "autoUpdate",
11+
}),
12+
],
13+
});

0 commit comments

Comments
 (0)