-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathvite.config.js
More file actions
104 lines (102 loc) · 3.12 KB
/
vite.config.js
File metadata and controls
104 lines (102 loc) · 3.12 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
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
99
100
101
102
103
104
import react from "@vitejs/plugin-react";
import path from "path";
import { fileURLToPath } from "url";
import { defineConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import { VitePWA } from "vite-plugin-pwa";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// https://vitejs.dev/config/
export default defineConfig({
build: {
assetsInlineLimit: 0,
},
plugins: [
react(),
nodePolyfills({
globals: {
Buffer: true, // Polyfill the Buffer global
},
}),
VitePWA({
registerType: "autoUpdate",
manifestFilename: "site.webmanifest",
includeAssets: [
"favicon.ico",
"favicon-16x16.png",
"favicon-32x32.png",
"apple-touch-icon.png",
"logo-48x48.png",
"logo-72x72.png",
"android-chrome-192x192.png",
"android-chrome-512x512.png",
"pwa/screenshot-wide.png",
"pwa/screenshot-narrow.png",
],
manifest: {
name: "Mybucks.online | Seedless, Disposable Crypto Wallet with 1-Click Gifting",
short_name: "Mybucks.online",
description:
"Mybucks.online is a seedless wallet and gifting wallet: create a disposable gift wallet, fund it, and share a secure 1-click URL. Browser-only—no servers, database, or install. Ideal for airdrops, giveaways, campaigns, and instant onboarding.",
start_url: "/",
scope: "/",
display: "standalone",
theme_color: "#ffffff",
background_color: "#ffffff",
icons: [
{
src: "/android-chrome-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "/android-chrome-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "any",
},
{
src: "/android-chrome-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
screenshots: [
{
src: "/pwa/screenshot-wide.png",
sizes: "1090x696",
type: "image/png",
form_factor: "wide",
label: "Sign in on desktop",
},
{
src: "/pwa/screenshot-narrow.png",
sizes: "390x844",
type: "image/png",
form_factor: "narrow",
label: "Sign in on mobile",
},
],
},
workbox: {
globPatterns: ["**/*.{js,css,html,ico,png,svg,woff2}"],
maximumFileSizeToCacheInBytes: 3 * 1024 * 1024,
},
// Set VITE_PWA_DEV=true to register SW + manifest locally (see package.json "dev:pwa")
devOptions: {
enabled: process.env.VITE_PWA_DEV === "true",
// dev-dist has no production bundle; Workbox globs would warn. Plugin uses a minimal dev pattern instead.
suppressWarnings: process.env.VITE_PWA_DEV === "true",
},
}),
],
resolve: {
alias: {
"@mybucks": path.resolve(__dirname, "./src"),
},
},
optimizeDeps: {
exclude: ["js-big-decimal"],
},
});