Spaces:
Runtime error
Runtime error
Download vite.config.ts from lasource87/bot: direct link, hf CLI and curl.
- Browser
- Download file 1.4 kB
-
https://huggingface.co/spaces/lasource87/bot/resolve/main/vite.config.ts
- Command line
-
hf download hf://spaces/lasource87/bot/vite.config.ts
-
curl -L -o vite.config.ts https://huggingface.co/spaces/lasource87/bot/resolve/main/vite.config.ts
1.4 kB
| import tailwindcss from '@tailwindcss/vite'; | |
| import react from '@vitejs/plugin-react'; | |
| import path from 'path'; | |
| import {defineConfig, loadEnv} from 'vite'; | |
| import obfuscator from 'vite-plugin-javascript-obfuscator'; | |
| export default defineConfig(({mode}) => { | |
| const env = loadEnv(mode, '.', ''); | |
| return { | |
| plugins: [ | |
| react(), | |
| tailwindcss(), | |
| // Obfuscation only in production to keep dev fast | |
| mode === 'production' ? (obfuscator as any)({ | |
| compact: true, | |
| controlFlowFlattening: true, | |
| controlFlowFlatteningThreshold: 0.75, | |
| numbersToExpressions: true, | |
| simplify: true, | |
| stringArrayThreshold: 0.75, | |
| splitStrings: true, | |
| splitStringsChunkLength: 10, | |
| unicodeEscapeSequence: false | |
| }) : [] | |
| ], | |
| define: { | |
| 'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY), | |
| 'import.meta.env.VITE_SUPABASE_URL': JSON.stringify(env.SUPABASE_URL), | |
| 'import.meta.env.VITE_SUPABASE_ANON_KEY': JSON.stringify(env.SUPABASE_ANON_KEY), | |
| }, | |
| resolve: { | |
| alias: { | |
| '@': path.resolve(__dirname, '.'), | |
| }, | |
| }, | |
| server: { | |
| // Autorise Hugging Face à afficher l'interface web | |
| allowedHosts: true, | |
| host: '0.0.0.0', | |
| port: 7860, | |
| // HMR is disabled in AI Studio via DISABLE_HMR env var. | |
| hmr: process.env.DISABLE_HMR !== 'true', | |
| }, | |
| }; | |
| }); | |