100 lines
2.5 KiB
TypeScript
100 lines
2.5 KiB
TypeScript
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||
|
|
import { defineConfig } from 'vite';
|
||
|
|
import { VitePWA } from 'vite-plugin-pwa';
|
||
|
|
|
||
|
|
export default defineConfig({
|
||
|
|
plugins: [
|
||
|
|
sveltekit(),
|
||
|
|
VitePWA({
|
||
|
|
registerType: 'autoUpdate',
|
||
|
|
includeAssets: ['favicon.png', 'icons/*.png'],
|
||
|
|
manifest: {
|
||
|
|
name: 'SvelteMUD Client',
|
||
|
|
short_name: 'SvelteMUD',
|
||
|
|
description: 'A modern MUD client built with Svelte',
|
||
|
|
theme_color: '#6272a4',
|
||
|
|
background_color: '#282a36',
|
||
|
|
display: 'standalone',
|
||
|
|
icons: [
|
||
|
|
{
|
||
|
|
src: 'icons/icon-72x72.png',
|
||
|
|
sizes: '72x72',
|
||
|
|
type: 'image/png',
|
||
|
|
purpose: 'any maskable'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
src: 'icons/icon-96x96.png',
|
||
|
|
sizes: '96x96',
|
||
|
|
type: 'image/png',
|
||
|
|
purpose: 'any maskable'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
src: 'icons/icon-128x128.png',
|
||
|
|
sizes: '128x128',
|
||
|
|
type: 'image/png',
|
||
|
|
purpose: 'any maskable'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
src: 'icons/icon-144x144.png',
|
||
|
|
sizes: '144x144',
|
||
|
|
type: 'image/png',
|
||
|
|
purpose: 'any maskable'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
src: 'icons/icon-152x152.png',
|
||
|
|
sizes: '152x152',
|
||
|
|
type: 'image/png',
|
||
|
|
purpose: 'any maskable'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
src: 'icons/icon-192x192.png',
|
||
|
|
sizes: '192x192',
|
||
|
|
type: 'image/png',
|
||
|
|
purpose: 'any maskable'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
src: 'icons/icon-384x384.png',
|
||
|
|
sizes: '384x384',
|
||
|
|
type: 'image/png',
|
||
|
|
purpose: 'any maskable'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
src: 'icons/icon-512x512.png',
|
||
|
|
sizes: '512x512',
|
||
|
|
type: 'image/png',
|
||
|
|
purpose: 'any maskable'
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
workbox: {
|
||
|
|
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
|
||
|
|
navigateFallback: null
|
||
|
|
},
|
||
|
|
strategies: 'generateSW',
|
||
|
|
devOptions: {
|
||
|
|
enabled: true,
|
||
|
|
type: 'module'
|
||
|
|
}
|
||
|
|
})
|
||
|
|
],
|
||
|
|
server: {
|
||
|
|
// No proxy - we're using a standalone WebSocket server on port 3001
|
||
|
|
},
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
events: 'events' // This helps with browser compatibility
|
||
|
|
}
|
||
|
|
},
|
||
|
|
optimizeDeps: {
|
||
|
|
esbuildOptions: {
|
||
|
|
define: {
|
||
|
|
global: 'globalThis'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
build: {
|
||
|
|
rollupOptions: {
|
||
|
|
external: ['net'] // Exclude Node-specific modules
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|