lernschiff/vite.config.js

54 lines
1.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(({ command }) => ({
plugins: [
tailwindcss(),
laravel({
input: ['resources/css/app.css', 'resources/js/auth.js', 'resources/js/app.js', 'resources/js/touch.js', 'resources/js/echo.js'],
refresh: true,
}),
VitePWA({
disable: command === 'serve',
registerType: 'autoUpdate',
manifest: false,
workbox: {
runtimeCaching: [
{
urlPattern: /\.(?:js|css|woff2?|png|svg|ico)$/i,
handler: 'CacheFirst',
options: {
cacheName: 'assets-cache',
cacheableResponse: { statuses: [200] },
expiration: {
maxEntries: 100,
maxAgeSeconds: 60 * 60 * 24 * 30,
},
},
},
{
urlPattern: /^https?:\/\/.+\/(?!api)/,
handler: 'NetworkOnly',
},
],
},
}),
],
server: {
host: '0.0.0.0',
port: 5173,
origin: 'https://app.dev.lernschiff.com',
watch: { ignored: ['**/storage/framework/views/**'] },
hmr: {
host: 'app.dev.lernschiff.com',
protocol: 'wss',
clientPort: 443,
path: '/vite-hmr',
},
allowedHosts: ['app.dev.lernschiff.com', 'localhost', '10.10.90.128'],
cors: true,
},
}));