diff --git a/src/components/layout/AppSidebar.vue b/src/components/layout/AppSidebar.vue index 7b5accf..b72fe4f 100644 --- a/src/components/layout/AppSidebar.vue +++ b/src/components/layout/AppSidebar.vue @@ -48,7 +48,7 @@ const isActive = (href: string) => {
Logo diff --git a/src/components/layout/MobileDrawer.vue b/src/components/layout/MobileDrawer.vue index 98b0740..5eeefd3 100644 --- a/src/components/layout/MobileDrawer.vue +++ b/src/components/layout/MobileDrawer.vue @@ -77,7 +77,7 @@ const navigateTo = (href: string) => { Logo diff --git a/src/pages/Login.vue b/src/pages/Login.vue index f0318ac..7f465f4 100644 --- a/src/pages/Login.vue +++ b/src/pages/Login.vue @@ -4,7 +4,7 @@
- Logo + Logo

Virtual Realm

diff --git a/src/pages/LoginDemo.vue b/src/pages/LoginDemo.vue index 13a8dd1..4fbb234 100644 --- a/src/pages/LoginDemo.vue +++ b/src/pages/LoginDemo.vue @@ -5,7 +5,7 @@
- Logo + Logo

Welcome to the Virtual Realm

diff --git a/vite-branding.ts b/vite-branding.ts new file mode 100644 index 0000000..99e871d --- /dev/null +++ b/vite-branding.ts @@ -0,0 +1,19 @@ +import { resolve } from 'node:path' + +/** + * Absolute path to the active brand kit. Deployers point this at their + * own `branding//` directory (see branding/README.md). + * + * Defaults to the committed aiolabs default brand. Used by vite configs + * for the `@brand` import alias and by pwa-assets.config.ts. + */ +export const BRAND_DIR = resolve(process.env.BRAND_DIR ?? './branding/default') + +/** + * Spread into a vite config's `resolve.alias` map. Lets components + * import deployer-provided assets via `@brand/` instead of + * hardcoding `@/assets/logo.png`. + */ +export const brandAlias = { + '@brand': BRAND_DIR, +} as const diff --git a/vite.chat.config.ts b/vite.chat.config.ts index c28535f..9d6c3c2 100644 --- a/vite.chat.config.ts +++ b/vite.chat.config.ts @@ -5,6 +5,7 @@ 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 { brandAlias } from './vite-branding' function chatHtmlPlugin(): Plugin { return { @@ -103,6 +104,7 @@ export default defineConfig(({ mode }) => ({ ], resolve: { alias: { + ...brandAlias, // ORDER MATTERS — @/app.config must precede @ (first-match-wins). '@/app.config': fileURLToPath(new URL('./src/chat-app/app.config.ts', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)), diff --git a/vite.config.ts b/vite.config.ts index b3de398..2bb909f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,6 +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 { brandAlias } from './vite-branding' // https://vite.dev/config/ // @@ -43,6 +44,7 @@ export default defineConfig(({ mode }) => ({ ], resolve: { alias: { + ...brandAlias, '@': fileURLToPath(new URL('./src', import.meta.url)) } }, diff --git a/vite.events.config.ts b/vite.events.config.ts index 76c2c31..967b1fe 100644 --- a/vite.events.config.ts +++ b/vite.events.config.ts @@ -5,6 +5,7 @@ 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 { brandAlias } from './vite-branding' /** * Plugin to rewrite dev server requests to events.html @@ -118,6 +119,7 @@ export default defineConfig(({ mode }) => ({ ], resolve: { alias: { + ...brandAlias, '@': fileURLToPath(new URL('./src', import.meta.url)), }, }, diff --git a/vite.forum.config.ts b/vite.forum.config.ts index 0fdebbe..1313a89 100644 --- a/vite.forum.config.ts +++ b/vite.forum.config.ts @@ -5,6 +5,7 @@ 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 { brandAlias } from './vite-branding' function forumHtmlPlugin(): Plugin { return { @@ -103,6 +104,7 @@ export default defineConfig(({ mode }) => ({ ], resolve: { alias: { + ...brandAlias, // ORDER MATTERS — @/app.config must precede @ (first-match-wins). '@/app.config': fileURLToPath(new URL('./src/forum-app/app.config.ts', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)), diff --git a/vite.libra.config.ts b/vite.libra.config.ts index cea9f6e..c792987 100644 --- a/vite.libra.config.ts +++ b/vite.libra.config.ts @@ -5,6 +5,7 @@ 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 { brandAlias } from './vite-branding' /** * Plugin to rewrite dev server requests to libra.html @@ -110,6 +111,7 @@ export default defineConfig(({ mode }) => ({ ], resolve: { alias: { + ...brandAlias, // ORDER MATTERS — @rollup/plugin-alias is first-match-wins. // The more specific @/app.config remap must precede the @ prefix // alias, otherwise '@/app.config' matches '@' first and resolves diff --git a/vite.market.config.ts b/vite.market.config.ts index bf38430..b3fc189 100644 --- a/vite.market.config.ts +++ b/vite.market.config.ts @@ -5,6 +5,7 @@ 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 { brandAlias } from './vite-branding' function marketHtmlPlugin(): Plugin { return { @@ -103,6 +104,7 @@ export default defineConfig(({ mode }) => ({ ], resolve: { alias: { + ...brandAlias, // ORDER MATTERS — @/app.config must precede @ (first-match-wins). '@/app.config': fileURLToPath(new URL('./src/market-app/app.config.ts', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)), diff --git a/vite.restaurant.config.ts b/vite.restaurant.config.ts index c9c697c..d95ff73 100644 --- a/vite.restaurant.config.ts +++ b/vite.restaurant.config.ts @@ -5,6 +5,7 @@ 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 { brandAlias } from './vite-branding' function restaurantHtmlPlugin(): Plugin { return { @@ -110,6 +111,7 @@ export default defineConfig(({ mode }) => ({ ], resolve: { alias: { + ...brandAlias, // ORDER MATTERS — @/app.config must precede @ (first-match-wins). '@/app.config': fileURLToPath(new URL('./src/restaurant-app/app.config.ts', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)), diff --git a/vite.tasks.config.ts b/vite.tasks.config.ts index 1edc3e6..cdce062 100644 --- a/vite.tasks.config.ts +++ b/vite.tasks.config.ts @@ -5,6 +5,7 @@ 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 { brandAlias } from './vite-branding' function tasksHtmlPlugin(): Plugin { return { @@ -103,6 +104,7 @@ export default defineConfig(({ mode }) => ({ ], resolve: { alias: { + ...brandAlias, // ORDER MATTERS — @/app.config must precede @ (first-match-wins). '@/app.config': fileURLToPath(new URL('./src/tasks-app/app.config.ts', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)), diff --git a/vite.wallet.config.ts b/vite.wallet.config.ts index f991672..fb34c51 100644 --- a/vite.wallet.config.ts +++ b/vite.wallet.config.ts @@ -5,6 +5,7 @@ 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 { brandAlias } from './vite-branding' /** * Plugin to rewrite dev server requests to wallet.html @@ -109,6 +110,7 @@ export default defineConfig(({ mode }) => ({ ], resolve: { alias: { + ...brandAlias, // ORDER MATTERS — @/app.config must precede @ (first-match-wins). '@/app.config': fileURLToPath(new URL('./src/wallet-app/app.config.ts', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)),