schneespur/vite.config.js
Michael 2c63440ed8 Revert: move code back to project root from schneespur/ subdirectory
- Reverts the schneespur/ subdirectory restructure (b8e426b)
- Restores package.json and vite.config.js (needed for npm build, were
  removed in an earlier cleanup before the restructure)
- Updates public/build/ assets with current Vite output (new content hashes)
2026-05-17 18:24:26 +00:00

82 lines
2.8 KiB
JavaScript

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import tailwindcss from '@tailwindcss/vite';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
tailwindcss(),
VitePWA({
registerType: 'autoUpdate',
strategies: 'generateSW',
outDir: 'public/build',
manifest: {
name: 'Schneespur',
short_name: 'Schneespur',
display: 'standalone',
theme_color: '#1e293b',
background_color: '#0f172a',
start_url: '/driver',
scope: '/',
icons: [
{
src: '/pwa-icon-192x192.png',
sizes: '192x192',
type: 'image/png',
purpose: 'any',
},
{
src: '/pwa-icon-192x192.png',
sizes: '192x192',
type: 'image/png',
purpose: 'maskable',
},
{
src: '/pwa-icon-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any',
},
{
src: '/pwa-icon-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable',
},
],
},
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff,woff2}'],
navigateFallback: null,
runtimeCaching: [
{
urlPattern: /\.(?:woff2?|ttf|eot|otf)$/,
handler: 'CacheFirst',
options: {
cacheName: 'fonts-cache',
expiration: {
maxEntries: 30,
maxAgeSeconds: 60 * 60 * 24 * 365,
},
},
},
{
urlPattern: /\/driver\/.*/,
handler: 'NetworkFirst',
options: {
cacheName: 'driver-pages-cache',
expiration: {
maxEntries: 50,
maxAgeSeconds: 60 * 60 * 24,
},
},
},
],
},
}),
],
});