Files
sencho/frontend/vite.config.ts
T
Anso ed553f1f19 feat: change default listen port from 3000 to 1852 (#756)
Updates the backend listen port, Vite dev proxy target, Docker EXPOSE,
compose port mapping, .env.example default, GitHub Actions smoke-test
default, healthcheck URLs, and every doc/example reference. Test fixtures
that include example URLs were updated for consistency, though their
assertions are port-agnostic.

The rate-limit value of 3000 in middleware/rateLimiters.ts and the
3000 entry in WEB_UI_PORTS (which detects user containers like Grafana)
are intentionally untouched.
2026-04-24 22:23:31 -04:00

42 lines
1.1 KiB
TypeScript

import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
import react from '@vitejs/plugin-react'
import path from 'path'
import { readFileSync } from 'fs'
const rootPkg = JSON.parse(readFileSync(path.resolve(__dirname, '../package.json'), 'utf-8'));
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
define: {
__APP_VERSION__: JSON.stringify(rootPkg.version),
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
// Disable the module-preload polyfill inline script.
// Vite injects a small inline <script> for module preloading that violates
// our CSP (script-src 'self' blocks all inline scripts). All modern browsers
// support <link rel="modulepreload"> natively, so the polyfill is unnecessary.
modulePreload: { polyfill: false },
},
server: {
proxy: {
'/api': {
target: 'http://localhost:1852',
changeOrigin: true,
ws: true,
},
'/ws': {
target: 'http://localhost:1852',
changeOrigin: true,
ws: true,
},
},
},
})