-
Notifications
You must be signed in to change notification settings - Fork 46
/
vite.config.ts
98 lines (96 loc) · 2.69 KB
/
vite.config.ts
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { VitePWA } from "vite-plugin-pwa";
import fundingPlugin from "vite-plugin-funding";
console.log("Build with:");
for (const [key, value] of Object.entries(process.env)) {
if (key.startsWith("VITE_")) console.log(`${key}: ${value}`);
}
// https://vitejs.dev/config/
export default defineConfig({
base: process.env.VITE_BASE ?? "/",
build: {
target: ["chrome89", "edge89", "firefox89", "safari15"],
sourcemap: true,
},
plugins: [
react(),
VitePWA({
registerType: "prompt",
// strategies: "injectManifest",
// srcDir: "src",
// filename: "sw.ts",
// devOptions: {
// // NOTE: ESM service workers is not supported by firefox
// type: "module",
// enabled: true,
// },
workbox: {
// This increase the cache limit to 4mB
maximumFileSizeToCacheInBytes: 2097152 * 2,
},
manifest: {
name: "noStrudel",
short_name: "noStrudel",
description: "A sandbox for exploring nostr",
display: "standalone",
orientation: "portrait-primary",
theme_color: "#8DB600",
categories: ["social"],
icons: [
{ src: "/favicon.ico", type: "image/x-icon", sizes: "16x16 32x32" },
{ src: "/icon-192.png", type: "image/png", sizes: "192x192" },
{ src: "/icon-512.png", type: "image/png", sizes: "512x512" },
{ src: "/icon-192-maskable.png", type: "image/png", sizes: "192x192", purpose: "maskable" },
{ src: "/icon-512-maskable.png", type: "image/png", sizes: "512x512", purpose: "maskable" },
],
lang: "en",
start_url: "/",
scope: "/",
shortcuts: [
{
name: "Notifications",
url: "/#/notifications",
description: "",
},
{
name: "Notes",
url: "/#/",
description: "",
},
{
name: "Notifications",
url: "/#/notifications",
description: "",
},
{
name: "Messages",
url: "/#/dm",
description: "",
},
{
name: "Streams",
url: "/#/streams",
description: "",
},
{
name: "Wiki",
url: "/#/wiki",
description: "",
},
],
protocol_handlers: [
{
protocol: "web+nostr",
url: "/l/%s",
},
{
protocol: "nostr",
url: "/l/%s",
},
],
},
}),
fundingPlugin({ types: ["lightning"] }),
],
});