feat(branding): add @brand vite alias + migrate in-app img consumers
vite-branding.ts is the shared resolver. Exports BRAND_DIR (absolute, defaults to ./branding/default) and brandAlias for spreading into each vite config's resolve.alias map. All 9 vite configs now spread brandAlias so `@brand/<file>` resolves to the active brand dir at build time. Migrates the four <img src="@/assets/logo.png"> consumers (Login.vue, LoginDemo.vue, AppSidebar.vue, MobileDrawer.vue) to @brand/logo.png. Unused Navbar.old.vue left as-is. Build verified: dist/assets/logo-<hash>.png emits from the aliased import. Future deployers point BRAND_DIR at their brand kit and the in-app logo follows automatically. Part of aiolabs/webapp#95. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
50a345ce4e
commit
eebb566323
14 changed files with 41 additions and 4 deletions
|
|
@ -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)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue