Files
superlist/apps/web/vite.config.ts
Jose Selesan 812d4b7170 feat(web): green, warm-paper theme with a matching dark mode
- New light palette (warm off-white background, white cards, grocery green
  primary) and a green-tinted charcoal dark mode; larger radius.
- Items render as one grouped card; bought items live in a collapsible
  "Comprados · N" card with a muted header.
- Pill-shaped add-item input (shadcn input-group) with a round add button.
- Progress summary ("N pendientes · M comprados" + bar) above the input.
- Active bottom-nav item uses the primary color with a dot.
- theme-color metas and PWA manifest follow the new background.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 14:55:48 -03:00

78 lines
2.6 KiB
TypeScript

import path from 'node:path'
import tailwindcss from '@tailwindcss/vite'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
const srcDir = path.resolve(import.meta.dirname, './src')
export default defineConfig({
plugins: [
// Must run before react(): it watches `src/routes` and generates `routeTree.gen.ts`.
tanstackRouter({ target: 'react', autoCodeSplitting: true }),
react(),
tailwindcss(),
VitePWA({
// `autoUpdate`: a new service worker activates as soon as it is installed
// and the page reloads into the new release. Registration (and the
// periodic update checks) live in `src/lib/register-sw.ts`.
registerType: 'autoUpdate',
injectRegister: false,
includeAssets: ['favicon.svg', 'apple-touch-icon.png'],
manifest: {
name: 'Superlist — Listas de compras compartidas',
short_name: 'Superlist',
description: 'Listas de compras compartidas con las personas de tu hogar.',
lang: 'es',
start_url: '/',
scope: '/',
display: 'standalone',
orientation: 'portrait',
theme_color: '#f9f8f5',
background_color: '#f9f8f5',
icons: [
{ src: 'pwa-192x192.png', sizes: '192x192', type: 'image/png' },
{ src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png' },
{
src: 'maskable-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable',
},
],
},
workbox: {
// Pre-cache the app shell (JS/CSS/HTML + self-hosted Geist fonts).
globPatterns: ['**/*.{js,css,html,svg,png,ico,woff2}'],
// SPA fallback so deep links work offline, but never swallow API calls.
navigateFallback: 'index.html',
navigateFallbackDenylist: [/^\/api\//],
// Drop caches left behind by previous releases once the new one activates.
cleanupOutdatedCaches: true,
// Take control of every open tab as soon as the new worker activates.
clientsClaim: true,
skipWaiting: true,
},
devOptions: {
// The service worker is only built for `vite build`; verify with `preview`.
enabled: false,
},
}),
],
resolve: {
alias: {
'@': srcDir,
},
},
server: {
port: 7153,
// Same-origin API in dev, mirroring nginx in production: the browser calls
// `/api/*` on the Vite server and it is forwarded to the Bun API.
proxy: {
'/api': 'http://localhost:4100',
},
},
})