58 lines
1.4 KiB
TypeScript
58 lines
1.4 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import { VitePWA } from "vite-plugin-pwa";
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
VitePWA({
|
|
registerType: "autoUpdate",
|
|
includeAssets: ["favicon.ico", "robots.txt", "apple-touch-icon.png"],
|
|
manifest: {
|
|
name: "Japan Trip Companion",
|
|
short_name: "Japan Trip",
|
|
description: "Companion app for Japan trip March 3-18, 2026",
|
|
theme_color: "#1a1a2e",
|
|
background_color: "#1a1a2e",
|
|
display: "standalone",
|
|
orientation: "portrait",
|
|
start_url: "/",
|
|
icons: [
|
|
{
|
|
src: "icon-192.png",
|
|
sizes: "192x192",
|
|
type: "image/png"
|
|
},
|
|
{
|
|
src: "icon-512.png",
|
|
sizes: "512x512",
|
|
type: "image/png"
|
|
}
|
|
]
|
|
},
|
|
workbox: {
|
|
globPatterns: ["**/*.{js,css,html,ico,png,svg,json}"],
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^https:\/\/[abc]\.tile\.openstreetmap\.org\/.*/i,
|
|
handler: "CacheFirst",
|
|
options: {
|
|
cacheName: "osm-tiles",
|
|
expiration: {
|
|
maxEntries: 500,
|
|
maxAgeSeconds: 60 * 60 * 24 * 30
|
|
},
|
|
cacheableResponse: {
|
|
statuses: [0, 200]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
})
|
|
],
|
|
server: {
|
|
host: true
|
|
}
|
|
});
|