Spaces:
Running
Running
Download source/frontend/vite.config.ts from Ethscriptions/eths: direct link, hf CLI and curl.
- Browser
- Download file 1.58 kB
-
https://huggingface.co/spaces/Ethscriptions/eths/resolve/main/source/frontend/vite.config.ts
- Command line
-
hf download hf://spaces/Ethscriptions/eths/source/frontend/vite.config.ts
-
curl -L -o vite.config.ts https://huggingface.co/spaces/Ethscriptions/eths/resolve/main/source/frontend/vite.config.ts
1.58 kB
| import viteErrorReporter from "./.vulcan-error-reporter.js"; | |
| import path from 'path' | |
| import { defineConfig } from 'vite' | |
| import react from '@vitejs/plugin-react' | |
| import tailwindcss from '@tailwindcss/vite' | |
| export default defineConfig(() => { | |
| const frontendPort = Number.parseInt(process.env.PORT || '', 10) | |
| const backendPort = Number.parseInt(process.env.BACKEND_PORT || '', 10) | |
| const base = process.env.BASE_PATH || './' | |
| const hasAbsBase = base.startsWith('/') | |
| const apiBasePrefix = hasAbsBase ? base.replace(/\/$/, '') : '' | |
| const backendProxy = { | |
| target: `http://127.0.0.1:${backendPort}`, | |
| changeOrigin: true, | |
| ...(hasAbsBase && { | |
| rewrite: (requestPath: string) => requestPath.replace(base, '/'), | |
| }), | |
| } | |
| return { | |
| cacheDir: process.env.VITE_CACHE_DIR || 'node_modules/.vite', | |
| plugins: [ | |
| viteErrorReporter({ vulcanDir: "/workspaces/.vulcan" }),react(), tailwindcss()], | |
| server: { | |
| allowedHosts: true, | |
| host: '0.0.0.0', | |
| port: frontendPort || undefined, | |
| proxy: { | |
| [`${apiBasePrefix}/api`]: backendProxy, | |
| }, | |
| hmr: { | |
| path: 'ws/vite-hmr', | |
| }, | |
| }, | |
| resolve: { | |
| alias: { | |
| '@': path.resolve(__dirname, './src'), | |
| }, | |
| dedupe: ['react', 'react-dom'], | |
| preserveSymlinks: true, | |
| }, | |
| optimizeDeps: { | |
| include: [ | |
| 'react', | |
| 'react-dom', | |
| 'react-dom/client', | |
| 'react/jsx-dev-runtime', | |
| 'react/jsx-runtime', | |
| '@tanstack/react-query', | |
| '@tanstack/query-core', | |
| ], | |
| }, | |
| base, | |
| } | |
| }) | |