feat(activities): brand-kit logo + app name in the events page header
Replace the bare "Events" h1 with the brand-kit logo paired with the
standalone's localized name. Deployers get per-standalone logo
control via branding/<dep>/icons/events/logo.{svg,png}; the
component itself stays brand-agnostic.
Brand-kit plumbing:
- `resolveAppLogo(app?)` in vite-branding.ts mirrors the resolution
chain pwa-assets.config.ts already uses for PWA icons
(per-standalone svg → png → global svg → png).
- `brandAppLogoAliasEntry(app)` returns a vite alias array entry. A
regex matches `@brand-app-logo` with or without a `?url` query so
the file resolves cleanly under either form.
- vite.events.config.ts switches its resolve.alias to the array form
so the per-standalone regex doesn't clash with the bare `@brand`
string alias.
Component side: a single `import brandAppLogoUrl from '@brand-app-logo?url'`
gives EventsPage the best-resolved logo without any fallback chain
in the component.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5e3d77efec
commit
443c8b6a37
4 changed files with 86 additions and 9 deletions
|
|
@ -5,7 +5,13 @@ import { defineConfig, type Plugin } from 'vite'
|
|||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer'
|
||||
import { visualizer } from 'rollup-plugin-visualizer'
|
||||
import { brand, brandAlias, brandAssetsPlugin, brandManifestName } from './vite-branding'
|
||||
import {
|
||||
brand,
|
||||
brandAlias,
|
||||
brandAppLogoAliasEntry,
|
||||
brandAssetsPlugin,
|
||||
brandManifestName,
|
||||
} from './vite-branding'
|
||||
|
||||
/**
|
||||
* Plugin to rewrite dev server requests to events.html
|
||||
|
|
@ -117,10 +123,14 @@ export default defineConfig(({ mode }) => ({
|
|||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
...brandAlias,
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
// Array form so we can mix the per-standalone logo regex (needs to
|
||||
// match `@brand-app-logo?url` query suffix) with the bare string
|
||||
// aliases without one shadowing the other.
|
||||
alias: [
|
||||
brandAppLogoAliasEntry('events'),
|
||||
...Object.entries(brandAlias).map(([find, replacement]) => ({ find, replacement })),
|
||||
{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) },
|
||||
],
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist-events',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue