-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
96 lines (94 loc) · 2.54 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
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import path from "path";
import svgr from "vite-plugin-svgr";
import { VitePWA } from "vite-plugin-pwa";
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
return {
plugins: [
react(),
svgr(),
nodePolyfills(),
VitePWA({
devOptions: {
enabled: env.NODE_ENV === "development",
},
// registerType: "autoUpdate",
// workbox: {
// globPatterns: ["**/*.{js,css,html,ico,png,svg}"],
// },
includeAssets: [
"favicon.ico",
"apple-touch-icon.png",
"pwa-192x192.png",
"pwa-512x512.png",
"pwa-maskable-192x192.png",
"pwa-maskable-512x512.png",
],
manifest: {
name: "Valid One PWA",
short_name: "Valid.One",
description: "An easy-onboard, secure identity management solution",
theme_color: "#ffffff",
start_url: "./#/id?utm_source=web_app_manifest",
id: "./#/id?utm_source=web_app_manifest",
display: "standalone",
scope: "/",
icons: [
{
src: "/images/pwa-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "/images/pwa-512x512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "/images/pwa-maskable-192x192.png",
sizes: "192x192",
type: "image/png",
purpose: "maskable",
},
{
src: "/images/pwa-maskable-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
screenshots: [
{
src: "/images/narrow.png",
type: "image/png",
sizes: "540x720",
form_factor: "narrow",
},
{
src: "/images/wide.png",
type: "image/png",
sizes: "720x500",
form_factor: "wide",
},
],
},
}),
],
server: {
host: "0.0.0.0",
},
build: {
outDir: "./dist",
},
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
define: { global: "window" },
};
});