dex/vite.config.js
chris 31cc076c0c Name the project Pocketdex; full README, CONTRIBUTING, LICENSE
Rename the app from the working-title "Pokédex" to Pocketdex across the
nav brand, install toast, PWA manifest, index.html title/meta, and
package.json. Generic in-universe uses of "Pokédex" (sub-dex label, "all
Pokédex entries", save-import messages) are left as-is.

Docs for going public:
- README.md rewritten: quick start, full feature list, how-it-works
  (data/storage split, per-game tracking, routing), deployment, legal
  disclaimer, contributing pointer.
- CONTRIBUTING.md: ground rules (no copyrighted assets, framework-free,
  offline-first), setup, project map, code style, common tasks, manual
  test checklist, PR conventions.
- LICENSE: MIT (+ note that it covers source only, not Pokémon data).
- .editorconfig, .github/PULL_REQUEST_TEMPLATE.md.
- package.json: add "engines": node >=20.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Ve7HLspzeG2xDPtJQ8vmu
2026-09-10 11:03:23 -04:00

80 lines
2.3 KiB
JavaScript

import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
// GitHub Pages / sub-path friendly: set BASE_PATH env at build time if needed.
const base = process.env.BASE_PATH || '/';
export default defineConfig({
base,
build: {
target: 'es2020',
sourcemap: true,
},
plugins: [
VitePWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.js',
registerType: 'prompt',
injectManifest: {
globPatterns: ['**/*.{js,css,html,svg,png,ico,json,webmanifest}'],
// The bundled PokéAPI snapshot can be a few hundred KB.
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
},
includeAssets: [
'icon.svg',
'favicon.svg',
'apple-touch-icon.png',
],
manifest: {
name: 'Pocketdex',
short_name: 'Pocketdex',
description:
'An offline-first Pokédex, team builder and save-file tracker powered by PokéAPI.',
start_url: './',
scope: './',
display: 'standalone',
orientation: 'portrait',
background_color: '#0b0b0c',
theme_color: '#b3161a',
categories: ['games', 'reference', 'utilities'],
icons: [
{ src: 'icon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'any' },
{ src: 'pwa-192.png', sizes: '192x192', type: 'image/png', purpose: 'any' },
{ src: 'pwa-512.png', sizes: '512x512', type: 'image/png', purpose: 'any' },
{
src: 'pwa-maskable-512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable',
},
],
shortcuts: [
{
name: 'Team builder',
short_name: 'Team',
url: './#/team',
icons: [{ src: 'pwa-192.png', sizes: '192x192' }],
},
{
name: 'Search',
short_name: 'Search',
url: './#/search',
icons: [{ src: 'pwa-192.png', sizes: '192x192' }],
},
{
name: 'Type chart',
short_name: 'Types',
url: './#/types',
icons: [{ src: 'pwa-192.png', sizes: '192x192' }],
},
],
},
devOptions: {
enabled: false,
type: 'module',
},
}),
],
});