Spaces:
Runtime error
Runtime error
Download client/vite.config.ts from Nryn215/FreeLLMAPI: direct link, hf CLI and curl.
- Browser
- Download file 950 Bytes
-
https://huggingface.co/spaces/Nryn215/FreeLLMAPI/resolve/main/client/vite.config.ts
- Command line
-
hf download hf://spaces/Nryn215/FreeLLMAPI/client/vite.config.ts
-
curl -L -o vite.config.ts https://huggingface.co/spaces/Nryn215/FreeLLMAPI/resolve/main/client/vite.config.ts
950 Bytes
| import { defineConfig, loadEnv } from 'vite' | |
| import react from '@vitejs/plugin-react' | |
| import tailwindcss from '@tailwindcss/vite' | |
| import path from 'path' | |
| export default defineConfig(({ mode }) => { | |
| const env = loadEnv(mode, path.resolve(__dirname, '..'), '') | |
| const serverPort = env.PORT ?? process.env.PORT ?? 3001 | |
| return { | |
| plugins: [react(), tailwindcss()], | |
| base: process.env.VITE_BASE ?? '/', | |
| envDir: path.resolve(__dirname, '..'), | |
| define: { | |
| __SERVER_PORT__: JSON.stringify(String(serverPort)), | |
| }, | |
| resolve: { | |
| alias: { | |
| '@': path.resolve(__dirname, './src'), | |
| }, | |
| }, | |
| server: { | |
| proxy: { | |
| // Force IPv4 — on Windows + Node 17+, `localhost` resolves to ::1 first, | |
| // which can collide with wslrelay / Docker Desktop listeners on the same port. | |
| '/api': `http://127.0.0.1:${serverPort}`, | |
| '/v1': `http://127.0.0.1:${serverPort}`, | |
| }, | |
| }, | |
| } | |
| }) | |