-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
82 lines (81 loc) · 2.04 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
import { defineConfig } from "vite"
import { VitePWA } from "vite-plugin-pwa"
import solid from "vite-plugin-solid"
import tsconfigPaths from "vite-tsconfig-paths"
export default defineConfig({
plugins: [
solid(),
tsconfigPaths(),
VitePWA({
strategies: "injectManifest",
srcDir: "src",
filename: "sw.ts",
devOptions: { enabled: true, type: "module" },
registerType: "autoUpdate",
includeAssets: [
"/pwa-192x192.png",
"/pwa-512x512.png",
"/safari-pinned-tab.svg",
],
manifest: {
name: "zSnout Learn",
short_name: "zSnout Learn",
description: "A flashcard application designed to help with studying.",
icons: [
{
src: "/pwa-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "/pwa-512x512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "/safari-pinned-tab.svg",
sizes: "any",
type: "image/svg",
purpose: "monochrome",
},
{
src: "/pwa-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "any",
},
{
src: "/pwa-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
theme_color: "#ffffff",
background_color: "#ffffff",
orientation: "natural",
edge_side_panel: { preferred_width: 375 },
id: "/",
display: "standalone",
},
}),
],
worker: {
format: "es",
plugins() {
return [tsconfigPaths()]
},
},
optimizeDeps: {
esbuildOptions: { target: "es2022" },
exclude: ["@sqlite.org/sqlite-wasm", "pyodide"],
},
esbuild: { target: "es2022" },
build: { target: "es2022" },
server: {
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
},
})