Initial commit: Japan PWA guide

This commit is contained in:
Cosmo
2026-03-21 04:59:39 +00:00
commit 7db42fd784
36 changed files with 5705 additions and 0 deletions

57
vite.config.ts Normal file
View File

@@ -0,0 +1,57 @@
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
}
});