forked from MutinyWallet/mutiny-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
80 lines (77 loc) · 2.28 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
import solid from "solid-start/vite";
import { defineConfig } from "vite";
import { VitePWA, VitePWAOptions } from "vite-plugin-pwa";
import wasm from "vite-plugin-wasm";
import autoprefixer from "autoprefixer";
import tailwindcss from "tailwindcss";
import * as path from "path";
const pwaOptions: Partial<VitePWAOptions> = {
base: "/",
registerType: "autoUpdate",
devOptions: {
enabled: false
},
includeAssets: ["favicon.ico", "robots.txt"],
manifest: {
name: "Mutiny Wallet",
short_name: "Mutiny",
description: "A lightning wallet",
theme_color: "#000",
icons: [
{
src: "192.png",
sizes: "192x192",
type: "image/png"
},
{
src: "512.png",
sizes: "512x512",
type: "image/png"
},
{
src: "maskable_icon.png",
sizes: "512x512",
type: "image/png",
purpose: "any maskable"
}
]
}
};
export default defineConfig({
server: {
port: 3420,
fs: {
// Allow serving files from one level up (so that if mutiny-node is a sibling folder we can use it locally)
allow: [".."]
}
},
plugins: [wasm(), solid({ ssr: false }), VitePWA(pwaOptions)],
resolve: {
alias: [{ find: "~", replacement: path.resolve(__dirname, "./src") }]
},
optimizeDeps: {
// Don't want vite to bundle these late during dev causing reload
include: [
"qr-scanner",
"@kobalte/core",
"@solid-primitives/upload",
"i18next",
"i18next-browser-languagedetector",
"@mutinywallet/barcode-scanner",
"@nostr-dev-kit/ndk",
"@capacitor/clipboard",
"@capacitor/core",
"@capacitor/filesystem",
"@capacitor/toast",
"@capacitor/app",
"@capacitor/browser",
],
// This is necessary because otherwise `vite dev` can't find the wasm
exclude: ["@mutinywallet/mutiny-wasm", "@mutinywallet/waila-wasm"]
},
css: {
postcss: {
plugins: [autoprefixer(), tailwindcss()]
}
}
});