Files
matrix_client_pc/frontend/vite.config.ts
T
egutierrez 41bafa57cc chore: auto-commit (17 archivos)
- app.md
- applog.go
- frontend/package.json
- frontend/package.json.md5
- frontend/vite.config.ts
- go.mod
- main.go
- matrix_service.go
- sqlite_driver.go
- .wails_dev.log
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:38:16 +02:00

43 lines
1.2 KiB
TypeScript

import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
import path from "node:path";
// E2E/dev mode: when VITE_E2E_API is set, swap Wails bindings for HTTP shims
// that hit the matrix_client_pc E2E HTTP server. The production `wails build`
// run does NOT set VITE_E2E_API -> bindings resolve to the real generated files.
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const useShim = !!env.VITE_E2E_API;
const aliases = useShim
? {
"../wailsjs/go/main/MatrixService": path.resolve(
__dirname,
"src/shims/MatrixServiceShim.ts",
),
"../../wailsjs/go/main/MatrixService": path.resolve(
__dirname,
"src/shims/MatrixServiceShim.ts",
),
"../wailsjs/runtime/runtime": path.resolve(
__dirname,
"src/shims/RuntimeShim.ts",
),
"../../wailsjs/runtime/runtime": path.resolve(
__dirname,
"src/shims/RuntimeShim.ts",
),
}
: {};
return {
plugins: [react()],
resolve: { alias: aliases },
server: {
host: "0.0.0.0",
port: 5173,
strictPort: false,
},
};
});