Scaffold and Phase 1
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { VitePWA } from "vite-plugin-pwa";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
VitePWA({
|
||||
registerType: "autoUpdate",
|
||||
workbox: {
|
||||
globPatterns: ["**/*.{js,css,html,ico,png,svg,woff2}"],
|
||||
runtimeCaching: [
|
||||
{
|
||||
// Cache API catalog responses (silent auction items) for offline browsing
|
||||
urlPattern: /\/api\/items/,
|
||||
handler: "NetworkFirst",
|
||||
options: {
|
||||
cacheName: "api-items",
|
||||
expiration: { maxEntries: 200, maxAgeSeconds: 60 * 60 },
|
||||
},
|
||||
},
|
||||
{
|
||||
// Always network-first for live bidding endpoints
|
||||
urlPattern: /\/api\/bids/,
|
||||
handler: "NetworkOnly",
|
||||
},
|
||||
],
|
||||
},
|
||||
manifest: {
|
||||
name: "Storybid Auction",
|
||||
short_name: "Storybid",
|
||||
description: "Live and silent charity auction bidding",
|
||||
theme_color: "#2563eb",
|
||||
background_color: "#ffffff",
|
||||
display: "standalone",
|
||||
orientation: "portrait",
|
||||
start_url: "/",
|
||||
icons: [
|
||||
{ src: "/icons/icon-192.png", sizes: "192x192", type: "image/png" },
|
||||
{ src: "/icons/icon-512.png", sizes: "512x512", type: "image/png", purpose: "any maskable" },
|
||||
],
|
||||
},
|
||||
}),
|
||||
],
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: {
|
||||
"/api": { target: "http://localhost:3001", changeOrigin: true },
|
||||
"/socket.io": { target: "http://localhost:3001", ws: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user