nostrudel/vite.config.ts

91 lines
2.5 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";
import tsconfigPaths from "vite-tsconfig-paths";
2023-02-07 17:04:18 -06:00
2024-11-08 13:27:12 +00:00
console.log("Build with:");
for (const [key, value] of Object.entries(process.env)) {
if (key.startsWith("VITE_")) console.log(`${key}: ${value}`);
}
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(),
tsconfigPaths(),
2023-02-07 17:04:18 -06:00
VitePWA({
2025-01-20 19:07:46 -06:00
// strategies: "injectManifest",
// srcDir: "src",
// filename: "worker.ts",
registerType: "prompt",
2025-01-20 19:07:46 -06:00
// injectRegister: null,
2025-01-14 21:57:09 -06:00
injectManifest: {
minify: false,
sourcemap: true,
// This increase the cache limit to 4mB
2025-01-17 19:12:22 -06:00
maximumFileSizeToCacheInBytes: 1024 * 1024 * 8,
2025-01-14 21:57:09 -06:00
},
2023-11-26 11:26:16 -06:00
workbox: {
// This increase the cache limit to 4mB
2025-01-17 19:12:22 -06:00
maximumFileSizeToCacheInBytes: 1024 * 1024 * 8,
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: "Notes",
2025-01-14 21:57:09 -06:00
url: "/",
2024-05-06 08:36:16 -05:00
description: "",
},
{
name: "Notifications",
2025-01-14 21:57:09 -06:00
url: "/notifications",
2024-05-06 08:36:16 -05:00
description: "",
},
{
name: "Messages",
2025-01-14 21:57:09 -06:00
url: "/messages",
2024-05-06 08:36:16 -05:00
description: "",
},
{
name: "Streams",
2025-01-14 21:57:09 -06:00
url: "/streams",
2024-05-06 08:36:16 -05:00
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
});