-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
46 lines (44 loc) · 1.57 KB
/
vite.config.js
File metadata and controls
46 lines (44 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { VitePWA } from "vite-plugin-pwa";
const base = "/fitness-tracker/";
export default defineConfig({
base,
plugins: [
react(),
VitePWA({
registerType: "autoUpdate",
includeAssets: ["icon-192.png", "icon-512.png", "icon-maskable-512.png", "screenshot-mobile.png"],
manifest: {
id: base,
name: "Anand's Fitness Tracker",
short_name: "Fitness",
description: "Weekly workout tracker with push/pull/legs split",
theme_color: "#080b10",
background_color: "#080b10",
display: "standalone",
orientation: "portrait",
start_url: base,
scope: base,
icons: [
{ src: "icon-192.png", sizes: "192x192", type: "image/png" },
{ src: "icon-512.png", sizes: "512x512", type: "image/png" },
{ src: "icon-maskable-512.png", sizes: "512x512", type: "image/png", purpose: "maskable" },
],
screenshots: [
{ src: "screenshot-mobile.png", sizes: "1080x1920", type: "image/png", form_factor: "narrow", label: "Weekly fitness tracker with workout checklists" },
],
},
workbox: {
globPatterns: ["**/*.{js,css,html,png,svg,ico}"],
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.(googleapis|gstatic)\.com\/.*/i,
handler: "CacheFirst",
options: { cacheName: "google-fonts", expiration: { maxEntries: 10, maxAgeSeconds: 365 * 24 * 60 * 60 } },
},
],
},
}),
],
});