Download apps/vis/web/vite.config.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vis/web/vite.config.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/apps/vis/web/vite.config.ts
-
curl -L -o vite.config.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vis/web/vite.config.ts
1.07 kB
| import { defineConfig } from 'vite'; | |
| import react from '@vitejs/plugin-react'; | |
| import tailwindcss from '@tailwindcss/vite'; | |
| import { viteSingleFile } from 'vite-plugin-singlefile'; | |
| const apiPort = Number(process.env.PORT) || 5174; | |
| const webPort = Number(process.env.WEB_PORT) || 5173; | |
| // When set, build a single self-contained index.html (JS+CSS inlined) into | |
| // `dist-single/` so it can be embedded into the kimi CLI. The normal `dist/` | |
| // build is unaffected. | |
| const singlefile = process.env.VIS_SINGLEFILE === '1'; | |
| export default defineConfig({ | |
| plugins: [ | |
| react(), | |
| tailwindcss(), | |
| ...(singlefile | |
| ? [ | |
| viteSingleFile({ | |
| useRecommendedBuildConfig: true, | |
| deleteInlinedFiles: true, | |
| }), | |
| ] | |
| : []), | |
| ], | |
| server: { | |
| port: webPort, | |
| strictPort: false, | |
| proxy: { | |
| '/api': { | |
| target: `http://localhost:${apiPort}`, | |
| changeOrigin: true, | |
| }, | |
| }, | |
| }, | |
| build: { | |
| outDir: singlefile ? 'dist-single' : 'dist', | |
| emptyOutDir: true, | |
| target: 'es2022', | |
| }, | |
| }); | |