diff options
Diffstat (limited to 'ping/frontend/vite.config.ts')
| -rw-r--r-- | ping/frontend/vite.config.ts | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ping/frontend/vite.config.ts b/ping/frontend/vite.config.ts new file mode 100644 index 0000000..ef26a3a --- /dev/null +++ b/ping/frontend/vite.config.ts @@ -0,0 +1,30 @@ +import tailwindcss from '@tailwindcss/vite'; +import devtoolsJson from 'vite-plugin-devtools-json'; +import { sveltekit } from '@sveltejs/kit/vite'; +import { defineConfig, loadEnv } from 'vite'; + +export default defineConfig(({ mode }) => { + // @ts-expect-error process is loaded + const env = loadEnv(mode, process.cwd()); + + console.log("Found API URL:", env.VITE_BACKEND_URL); + + const API_URL = (env.VITE_BACKEND_URL ?? "http://127.0.1:8080"); + + return { + plugins: [tailwindcss(), sveltekit(), devtoolsJson()], + optimizeDeps: { + exclude: ['chart.js'] + }, + server: { + proxy: { + '/api': API_URL + }, + allowedHosts: [ + 'patapimvest.esteban-charvin.dev', + 'localhost', + '127.0.0.1' + ], + } + } +}); |
