nostrudel/vite.config.ts

92 lines
2.4 KiB
TypeScript
Raw Permalink Normal View History

2023-02-07 17:04:18 -06:00
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
2023-02-07 17:04:18 -06:00
import { VitePWA } from "vite-plugin-pwa";
2023-02-07 17:04:18 -06:00
// https://vitejs.dev/config/
export default defineConfig({
2023-07-02 14:29:18 -05:00
base: process.env.VITE_BASE ?? "/",
2023-02-07 17:04:18 -06:00
build: {
target: ["chrome89", "edge89", "firefox89", "safari15"],
2023-10-07 11:54:02 -05:00
sourcemap: true,
2023-02-07 17:04:18 -06:00
},
2023-02-07 17:04:18 -06:00
plugins: [
react(),
VitePWA({
2023-02-07 17:04:19 -06:00
registerType: "prompt",
// strategies: "injectManifest",
// srcDir: "src",
// filename: "sw.ts",
// devOptions: {
// // NOTE: ESM service workers is not supported by firefox
// type: "module",
// enabled: true,
// },
2023-11-26 11:26:16 -06:00
workbox: {
// This increase the cache limit to 4mB
maximumFileSizeToCacheInBytes: 2097152 * 2,
2023-11-26 11:26:16 -06:00
},
2023-02-07 17:04:18 -06:00
manifest: {
2023-02-07 17:04:19 -06:00
name: "noStrudel",
short_name: "noStrudel",
2023-12-08 12:20:08 -06:00
description: "A sandbox for exploring nostr",
2024-05-06 08:36:16 -05:00
display: "standalone",
orientation: "portrait-primary",
2023-02-07 17:04:19 -06:00
theme_color: "#8DB600",
2024-05-06 08:36:16 -05:00
categories: ["social"],
2023-02-07 17:04:18 -06:00
icons: [
{ src: "/favicon.ico", type: "image/x-icon", sizes: "16x16 32x32" },
{ src: "/icon-192.png", type: "image/png", sizes: "192x192" },
{ src: "/icon-512.png", type: "image/png", sizes: "512x512" },
{ src: "/icon-192-maskable.png", type: "image/png", sizes: "192x192", purpose: "maskable" },
{ src: "/icon-512-maskable.png", type: "image/png", sizes: "512x512", purpose: "maskable" },
],
2024-05-06 08:36:16 -05:00
lang: "en",
start_url: "/",
scope: "/",
shortcuts: [
{
name: "Notifications",
url: "/#/notifications",
description: "",
},
{
name: "Notes",
url: "/#/",
description: "",
},
{
name: "Notifications",
url: "/#/notifications",
description: "",
},
{
name: "Messages",
url: "/#/dm",
description: "",
},
{
name: "Streams",
url: "/#/streams",
description: "",
},
{
name: "Wiki",
url: "/#/wiki",
description: "",
},
],
protocol_handlers: [
{
protocol: "web+nostr",
url: "/l/%s",
},
{
protocol: "nostr",
url: "/l/%s",
},
],
2023-02-07 17:04:18 -06:00
},
}),
],
2023-02-07 17:04:18 -06:00
});