mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import { VitePWA } from 'vite-plugin-pwa';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
export default defineConfig({
|
|
server: { port: 5123, open: false },
|
|
preview: { port: 4001, open: false },
|
|
publicDir: 'public',
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: { silenceDeprecations: ['legacy-js-api'] }
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
plugins: [
|
|
vue(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
workbox: {
|
|
disableDevLogs: true,
|
|
globPatterns: ['**/*.{js,css,html,ico,woff,woff2,ttf}', '**/*.{png,jpg,jpeg,svg,webp,gif}'],
|
|
cleanupOutdatedCaches: true,
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern:
|
|
/^https:\/\/stacjownik.spythere.eu\/api\/(getVehiclesData|getDonators|getSceneries)/i,
|
|
handler: 'StaleWhileRevalidate',
|
|
options: {
|
|
cacheName: 'stacjownik-api-cache',
|
|
cacheableResponse: { statuses: [0, 200] },
|
|
expiration: {
|
|
maxAgeSeconds: 3600
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
devOptions: { enabled: true, suppressWarnings: true }
|
|
})
|
|
]
|
|
});
|