-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
51 lines (49 loc) · 1.36 KB
/
vite.config.js
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
import * as path from "path"
import {defineConfig} from "vite"
import {VitePWA} from "vite-plugin-pwa"
import mkcert from "vite-plugin-mkcert"
import sveltePreprocess from "svelte-preprocess"
import {svelte} from "@sveltejs/vite-plugin-svelte"
import {nodePolyfills} from "vite-plugin-node-polyfills"
export default defineConfig({
server: {
https: false,
},
build: {
sourcemap: true,
},
resolve: {
alias: {
src: path.resolve(__dirname, "src"),
},
},
plugins: [
mkcert(),
nodePolyfills({
protocolImports: true,
}),
VitePWA({
registerType: "autoUpdate",
injectRegister: "auto",
manifest: {
name: process.env.VITE_APP_NAME,
short_name: process.env.VITE_APP_NAME,
description: "Nostr, your way.",
theme_color: "#EB5E28",
protocol_handlers: [{protocol: "web+nostr", url: "/%s"}],
icons: [
{type: "image/png", sizes: "192x192", src: "/images/favicon/android-icon-192x192.png"},
{type: "image/png", sizes: "512x512", src: "/images/favicon/android-icon-512x512.png"},
],
},
}),
svelte({
preprocess: sveltePreprocess(),
onwarn: (warning, handler) => {
if (warning.code.startsWith("a11y-")) return
if (warning.filename.includes("node_modules")) return
handler(warning)
},
}),
],
})