Skip to content

Commit

Permalink
feat: vite pwa
Browse files Browse the repository at this point in the history
  • Loading branch information
Grafikart committed Sep 4, 2024
1 parent 3171ffb commit 2ec6ec2
Show file tree
Hide file tree
Showing 3 changed files with 1,974 additions and 36 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"typescript-eslint": "^8.0.1",
"vite": "^5.4.1",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-plugin-pwa": "^0.20.3",
"vite-plugin-svgr": "^4.2.0"
},
"scripts": {
Expand Down
13 changes: 12 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import svgr from "vite-plugin-svgr";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import { VitePWA } from "vite-plugin-pwa";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [svgr(), react(), nodePolyfills()],
plugins: [
svgr(),
react(),
nodePolyfills(),
VitePWA({
workbox: {
maximumFileSizeToCacheInBytes: 15_000_000,
},
registerType: "autoUpdate",
}),
],
server: {
port: 3000,
},
Expand Down
Loading

0 comments on commit 2ec6ec2

Please sign in to comment.