- Add a notification manager to handle push notifications and integrate with Nostr events. - Create a push notification service to manage subscription and permission requests. - Introduce components for notification settings and permission prompts in the UI. - Update Nostr store to manage push notification state and enable/disable functionality. - Enhance NostrFeed to send notifications for new admin announcements. - Implement test notification functionality for development purposes.
98 lines
2.4 KiB
TypeScript
98 lines
2.4 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import { defineConfig } from 'vite'
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
import Inspect from 'vite-plugin-inspect'
|
|
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer'
|
|
import { visualizer } from 'rollup-plugin-visualizer'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(({ mode }) => ({
|
|
plugins: [
|
|
vue(),
|
|
tailwindcss(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
devOptions: {
|
|
enabled: true
|
|
},
|
|
strategies: 'injectManifest',
|
|
srcDir: 'public',
|
|
filename: 'sw.js',
|
|
workbox: {
|
|
globPatterns: [
|
|
'**/*.{js,css,html,ico,png,svg}'
|
|
]
|
|
},
|
|
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'mask-icon.svg'],
|
|
manifest: {
|
|
name: 'Vue Shadcn App',
|
|
short_name: 'Vue App',
|
|
description: 'A Vue 3 app with Shadcn UI',
|
|
theme_color: '#ffffff',
|
|
background_color: '#ffffff',
|
|
display: 'standalone',
|
|
orientation: 'portrait',
|
|
start_url: '/',
|
|
scope: '/',
|
|
id: 'ario-nostr-hub',
|
|
categories: ['social', 'utilities'],
|
|
lang: 'en',
|
|
icons: [
|
|
{
|
|
src: 'pwa-192x192.png',
|
|
sizes: '192x192',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'pwa-512x512.png',
|
|
sizes: '512x512',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'pwa-512x512.png',
|
|
sizes: '512x512',
|
|
type: 'image/png',
|
|
purpose: 'any maskable'
|
|
}
|
|
]
|
|
}
|
|
}),
|
|
Inspect(),
|
|
ViteImageOptimizer({
|
|
jpg: {
|
|
quality: 80
|
|
},
|
|
png: {
|
|
quality: 80
|
|
},
|
|
webp: {
|
|
lossless: true
|
|
}
|
|
}),
|
|
mode === 'analyze' && visualizer({
|
|
open: true,
|
|
filename: 'dist/stats.html',
|
|
gzipSize: true,
|
|
brotliSize: true
|
|
})
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
'vue-vendor': ['vue', 'vue-router', 'pinia'],
|
|
'ui-vendor': ['radix-vue', '@vueuse/core'],
|
|
'shadcn': ['class-variance-authority', 'clsx', 'tailwind-merge']
|
|
}
|
|
}
|
|
},
|
|
chunkSizeWarningLimit: 1000
|
|
}
|
|
}))
|