64 lines
1.7 KiB
JavaScript
64 lines
1.7 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
tailwindcss(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,svg,wasm}'],
|
|
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^https?:\/\/.*\/api\//,
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'api-cache',
|
|
expiration: { maxEntries: 50, maxAgeSeconds: 300 },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
manifest: {
|
|
name: 'ROA AUTO - Management Service Auto',
|
|
short_name: 'ROA AUTO',
|
|
description: 'Aplicatie de management pentru service-uri auto',
|
|
theme_color: '#111827',
|
|
background_color: '#f9fafb',
|
|
display: 'standalone',
|
|
orientation: 'portrait-primary',
|
|
start_url: '/',
|
|
scope: '/',
|
|
icons: [
|
|
{ src: '/icon-192.png', sizes: '192x192', type: 'image/png' },
|
|
{ src: '/icon-512.png', sizes: '512x512', type: 'image/png' },
|
|
{ src: '/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
|
|
],
|
|
},
|
|
}),
|
|
],
|
|
server: {
|
|
watch: {
|
|
usePolling: true,
|
|
interval: 1000,
|
|
},
|
|
headers: {
|
|
'Cross-Origin-Opener-Policy': 'same-origin',
|
|
'Cross-Origin-Embedder-Policy': 'require-corp',
|
|
},
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8000',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
optimizeDeps: {
|
|
exclude: ['@journeyapps/wa-sqlite'],
|
|
},
|
|
})
|