2023-03-13 19:31:31 +00:00
|
|
|
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"
|
2022-11-23 01:28:33 +00:00
|
|
|
|
|
|
|
export default defineConfig({
|
2023-02-11 20:59:09 +00:00
|
|
|
server: {
|
|
|
|
https: false,
|
|
|
|
},
|
2022-12-06 05:46:40 +00:00
|
|
|
build: {
|
|
|
|
sourcemap: true,
|
|
|
|
},
|
2022-11-23 01:28:33 +00:00
|
|
|
resolve: {
|
2022-11-24 03:54:22 +00:00
|
|
|
alias: {
|
2023-03-13 19:31:31 +00:00
|
|
|
src: path.resolve(__dirname, "src"),
|
|
|
|
},
|
2022-11-23 01:28:33 +00:00
|
|
|
},
|
2022-11-24 03:54:22 +00:00
|
|
|
plugins: [
|
2023-02-11 20:59:09 +00:00
|
|
|
mkcert(),
|
2022-11-24 03:54:22 +00:00
|
|
|
nodePolyfills({
|
|
|
|
protocolImports: true,
|
|
|
|
}),
|
2023-02-27 21:44:05 +00:00
|
|
|
VitePWA({
|
2023-03-13 19:31:31 +00:00
|
|
|
registerType: "autoUpdate",
|
|
|
|
injectRegister: "auto",
|
2023-02-27 21:44:05 +00:00
|
|
|
manifest: {
|
2023-04-26 20:52:13 +00:00
|
|
|
name: process.env.VITE_APP_NAME,
|
|
|
|
short_name: process.env.VITE_APP_NAME,
|
2023-03-13 19:31:31 +00:00
|
|
|
description: "Nostr, your way.",
|
|
|
|
theme_color: "#EB5E28",
|
2023-02-27 21:44:05 +00:00
|
|
|
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"},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}),
|
2022-11-24 03:54:22 +00:00
|
|
|
svelte({
|
2023-02-03 23:01:29 +00:00
|
|
|
preprocess: sveltePreprocess(),
|
2022-11-24 03:54:22 +00:00
|
|
|
onwarn: (warning, handler) => {
|
2023-03-13 19:31:31 +00:00
|
|
|
if (warning.code.startsWith("a11y-")) return
|
2023-02-03 23:01:29 +00:00
|
|
|
if (warning.filename.includes("node_modules")) return
|
|
|
|
|
2022-11-24 03:54:22 +00:00
|
|
|
handler(warning)
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
2022-11-23 01:28:33 +00:00
|
|
|
})
|