web-app/vite.config.ts
padreug cc6ba2612d feat: Update app configuration and enhance identity management
- Change app manifest details to reflect new branding for "Ario - Nostr Community Hub".
- Add new properties to the manifest, including categories and language support.
- Refactor identity handling in IdentityDialog and PasswordDialog components for improved profile initialization.
- Update event creation functions in events.ts to use the correct event type from nostr-tools.
2025-07-12 18:10:33 +02:00

108 lines
2.7 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: 'Ario - Nostr Community Hub',
short_name: 'Ario',
description: 'Nostr-based community platform with Lightning Network integration for events and announcements',
theme_color: '#1f2937',
background_color: '#ffffff',
display: 'standalone',
orientation: 'portrait-primary',
start_url: '/',
scope: '/',
id: 'ario-nostr-hub',
categories: ['social', 'utilities'],
lang: 'en',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
purpose: 'any'
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any'
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable'
}
],
screenshots: [
{
src: 'splash.png',
sizes: '1080x1920',
type: 'image/png',
form_factor: 'narrow'
}
]
}
}),
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
}
}))