lilith-platform.live/codebase/@features/messages/frontend-user/vite.config.ts
Natalie 5769d5c874 feat(messenger): canonical domain messenger.transquinnftw.com
Align the messaging surface with other quinn.* subdomains (my, admin, data).
m.transquinnftw.com and m.quinn.apricot.lan now 301 to messenger.*.
App switcher id/subdomain updated to messenger; shared SAN cert expanded
on deploy.
2026-06-23 07:55:54 -04:00

55 lines
1.9 KiB
TypeScript

import react from '@vitejs/plugin-react';
import { realpathSync } from 'fs';
import { resolve } from 'path';
import { defineConfig } from 'vite';
import { versionPlugin } from '@lilith/vite-version-plugin';
// Resolve styled-components through ui-styled-components's own dependency to
// ensure a single shared instance. Bun stores packages content-addressed so
// we use realpathSync to get a stable absolute path.
const uiScPkg = resolve(__dirname, './node_modules/@lilith/ui-styled-components');
const uiScReal = realpathSync(uiScPkg);
// Sibling in the same bun content-hash bucket
const styledComponentsReal = realpathSync(resolve(uiScReal, '../../styled-components'));
export default defineConfig({
plugins: [
react(),
versionPlugin({ appName: 'Quinn Messages', versionFile: resolve(__dirname, '../../../../VERSION.txt') }),
],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
// Route bare styled-components to the real singleton via ui-styled-components's dep.
'styled-components': styledComponentsReal,
},
dedupe: [
'react',
'react-dom',
'styled-components',
'@tanstack/react-query',
'@lilith/ui-theme',
'@lilith/ui-primitives',
],
},
server: {
host: '127.0.0.1',
port: 5175,
// Accept Host headers from the apricot dev Caddy proxy. Vite 6 rejects
// unknown hosts by default as a DNS-rebinding guard, which would break
// the `https://messenger.quinn.apricot.lan → Caddy → :5175` path.
allowedHosts: ['localhost', '127.0.0.1', 'messenger.quinn.apricot.lan'],
proxy: {
// Dev-only: direct-to-Vite access (http://127.0.0.1:5175) still works.
// Via Caddy, the /api/* handle forwards straight to backend-user.
'/api': {
target: 'http://localhost:3105',
changeOrigin: true,
},
},
},
build: {
outDir: 'dist',
sourcemap: true,
},
});