mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
GitHub Pages only serves static files, but the real app needs a Node gateway and Rust connector to speak the TS3 protocol - neither of which can run there. This adds a fake WebSocket (DemoSocket) that simulates a connection with canned channels/clients entirely client-side, gated behind VITE_DEMO_MODE so the normal Docker build is unaffected, plus a GitHub Actions workflow that builds and publishes it to Pages. Also fixes a real bug surfaced while testing the disconnect flow: a clean disconnect incorrectly showed "Connection closed before the server responded" because the socket's onclose handler couldn't tell a clean disconnect apart from one that never connected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
11 lines
362 B
TypeScript
11 lines
362 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
// Set by the GitHub Pages workflow to the repo subpath (e.g. /webspeak3/);
|
|
// the normal Docker build serves from the domain root and leaves this unset.
|
|
base: process.env.VITE_BASE_PATH || '/',
|
|
})
|