You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
2.5 KiB
93 lines
2.5 KiB
import { sveltekit } from '@sveltejs/kit/vite'; |
|
import { defineConfig } from 'vite'; |
|
import { execSync } from 'child_process'; |
|
import { SvelteKitPWA } from '@vite-pwa/sveltekit'; |
|
|
|
export default defineConfig({ |
|
plugins: [ |
|
sveltekit(), |
|
SvelteKitPWA({ |
|
strategies: 'generateSW', |
|
registerType: 'autoUpdate', |
|
workbox: { |
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff,woff2,webp,avif}'], |
|
runtimeCaching: [ |
|
{ |
|
urlPattern: /^https:\/\/.*\.(?:png|jpg|jpeg|svg|gif|webp|avif)$/i, |
|
handler: 'CacheFirst', |
|
options: { |
|
cacheName: 'images-cache', |
|
expiration: { |
|
maxEntries: 100, |
|
maxAgeSeconds: 60 * 60 * 24 * 30 // 30 days |
|
} |
|
} |
|
} |
|
] |
|
}, |
|
manifest: { |
|
name: 'aitherboard - Decentralized Messageboard on Nostr', |
|
short_name: 'aitherboard', |
|
description: 'A decentralized messageboard built on the Nostr protocol. Create threads, comment, react, and zap in a censorship-resistant environment.', |
|
theme_color: '#f1f5f9', |
|
background_color: '#ffffff', |
|
display: 'standalone', |
|
icons: [ |
|
{ |
|
src: 'favicon.ico', |
|
sizes: '64x64', |
|
type: 'image/x-icon' |
|
}, |
|
{ |
|
src: 'apple-touch-icon-180x180.png', |
|
sizes: '180x180', |
|
type: 'image/png', |
|
purpose: 'any maskable' |
|
}, |
|
{ |
|
src: 'apple-touch-icon-152x152.png', |
|
sizes: '152x152', |
|
type: 'image/png' |
|
}, |
|
{ |
|
src: 'apple-touch-icon-144x144.png', |
|
sizes: '144x144', |
|
type: 'image/png' |
|
}, |
|
{ |
|
src: 'apple-touch-icon-120x120.png', |
|
sizes: '120x120', |
|
type: 'image/png' |
|
}, |
|
{ |
|
src: 'apple-touch-icon-114x114.png', |
|
sizes: '114x114', |
|
type: 'image/png' |
|
} |
|
] |
|
}, |
|
devOptions: { |
|
enabled: false |
|
} |
|
}), |
|
{ |
|
name: 'generate-healthz', |
|
buildStart() { |
|
try { |
|
execSync('node scripts/generate-healthz.js', { stdio: 'inherit' }); |
|
} catch (error) { |
|
console.warn('Failed to generate healthz.json:', error); |
|
} |
|
} |
|
} |
|
], |
|
server: { |
|
port: 5173, |
|
strictPort: false |
|
}, |
|
build: { |
|
target: 'esnext', |
|
sourcemap: false, |
|
manifest: false |
|
} |
|
});
|
|
|