-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
72 lines (70 loc) · 1.87 KB
/
vite.config.js
File metadata and controls
72 lines (70 loc) · 1.87 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import path from "path";
import framework7 from "rollup-plugin-framework7";
import { VitePWA } from "vite-plugin-pwa";
const SRC_DIR = path.resolve(__dirname, "./src");
const PUBLIC_DIR = path.resolve(__dirname, "./public");
const BUILD_DIR = path.resolve(__dirname, "./www");
export default async () => {
return {
plugins: [
framework7({ emitCss: false }),
VitePWA({
registerType: "autoUpdate", // ✅ Check for updates automatically
injectRegister: "auto", // ✅ Ensures it's included in build
includeAssets: [
"favicon.png",
"icons/icon-192x192.png",
"icons/icon-512x512.png",
],
workbox: {
skipWaiting: true, // ✅ Activate updated SW immediately
clientsClaim: true, // ✅ Refresh all tabs using it
cleanupOutdatedCaches: true, // ✅ Clear old versions
},
manifest: {
name: "Petal Frame",
short_name: "PetalFrame",
start_url: "/",
display: "standalone",
background_color: "#ffffff",
theme_color: "#35a9d2",
icons: [
{
src: "icons/icon-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "icons/icon-512x512.png",
sizes: "512x512",
type: "image/png",
},
],
},
}),
],
root: SRC_DIR,
base: "", // If you're deploying to a subpath, update this
publicDir: PUBLIC_DIR,
build: {
outDir: BUILD_DIR,
assetsInlineLimit: 0,
emptyOutDir: true,
rollupOptions: {
treeshake: false,
},
},
resolve: {
alias: {
"@": SRC_DIR,
},
},
server: {
host: true,
},
esbuild: {
jsxFactory: "$jsx",
jsxFragment: '"Fragment"',
},
};
};