feat(branding): auto-generate icons on vite build/dev start
vite-branding.ts now exports brandAssetsPlugin() — a Vite plugin whose buildStart hook runs scripts/generate-pwa-assets.mjs once per build / dev-server start. All 9 vite configs register it first in plugins[], so PWA icons under public/icons/ are guaranteed to exist before VitePWA's includeAssets / manifest.icons get processed and before the public/ → dist/ copy. Removes the "did you remember to pnpm generate-pwa-assets?" failure mode. Dev mode now also auto-populates icons (no more dev 404s on /icons/favicon.ico). Verified build from clean state (no public/icons/ pre-existing): the plugin generates, all 6 icons land in dist-wallet/icons/. Part of aiolabs/webapp#95. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
faf41cd1c0
commit
3efae30e84
10 changed files with 45 additions and 9 deletions
|
|
@ -5,7 +5,7 @@ import { defineConfig } from 'vite'
|
|||
import Inspect from 'vite-plugin-inspect'
|
||||
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer'
|
||||
import { visualizer } from 'rollup-plugin-visualizer'
|
||||
import { brand, brandAlias } from './vite-branding'
|
||||
import { brand, brandAlias, brandAssetsPlugin } from './vite-branding'
|
||||
|
||||
// https://vite.dev/config/
|
||||
//
|
||||
|
|
@ -26,6 +26,7 @@ export default defineConfig(({ mode }) => ({
|
|||
strictPort: true,
|
||||
},
|
||||
plugins: [
|
||||
brandAssetsPlugin(),
|
||||
vue(),
|
||||
tailwindcss(),
|
||||
Inspect(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue