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
|
|
|
|
2023-10-06 12:06:02 -05:00
|
|
|
const isProd = process.env.NODE_ENV === "production";
|
|
|
|
process.env.VITE_ANALYTICS_SCRIPT = isProd
|
|
|
|
? `
|
|
|
|
<script
|
|
|
|
async defer
|
|
|
|
src="https://ackee.nostrudel.ninja/tracker.js"
|
|
|
|
data-ackee-server="https://ackee.nostrudel.ninja"
|
|
|
|
data-ackee-domain-id="58b1c39f-43f9-422b-bc7d-06aff35e764e"
|
|
|
|
></script>`
|
|
|
|
: "";
|
|
|
|
|
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-02-07 17:04:18 -06:00
|
|
|
plugins: [
|
|
|
|
react(),
|
|
|
|
VitePWA({
|
2023-02-07 17:04:19 -06:00
|
|
|
registerType: "prompt",
|
2023-02-07 17:04:18 -06:00
|
|
|
manifest: {
|
2023-02-07 17:04:19 -06:00
|
|
|
name: "noStrudel",
|
|
|
|
short_name: "noStrudel",
|
2023-02-07 17:04:18 -06:00
|
|
|
description: "A simple PWA nostr client",
|
2023-07-30 15:19:04 -05:00
|
|
|
orientation: "any",
|
2023-02-07 17:04:19 -06:00
|
|
|
theme_color: "#8DB600",
|
2023-02-07 17:04:18 -06:00
|
|
|
categories: ["nostr"],
|
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" },
|
|
|
|
],
|
|
|
|
// TODO: actually handle this share data
|
|
|
|
// @ts-ignore
|
|
|
|
share_target: {
|
|
|
|
action: "/share",
|
|
|
|
method: "GET",
|
2023-02-07 17:04:18 -06:00
|
|
|
enctype: "application/x-www-form-urlencoded",
|
2023-02-07 17:04:18 -06:00
|
|
|
params: {
|
|
|
|
title: "title",
|
|
|
|
text: "text",
|
|
|
|
url: "url",
|
|
|
|
},
|
|
|
|
},
|
2023-02-07 17:04:18 -06:00
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
2023-02-07 17:04:18 -06:00
|
|
|
});
|