A very performant and light (2mb in memory) link shortener and tracker. Written in Rust and React and uses Postgres/SQLite.
1import { defineConfig, loadEnv } from 'vite'
2import react from '@vitejs/plugin-react'
3import tailwindcss from '@tailwindcss/vite'
4import path from "path"
5
6// https://vitejs.dev/config/
7export default defineConfig(({ mode }) => {
8 // Load env file based on `mode` in the current working directory.
9 const env = loadEnv(mode, process.cwd(), '')
10
11 return {
12 plugins: [
13 react(),
14 tailwindcss(),
15 ],
16 server: {
17 proxy: {
18 '/api': {
19 // Use environment variable with fallback
20 target: env.VITE_API_URL || 'http://localhost:3000',
21 changeOrigin: true,
22 },
23 },
24 },
25 resolve: {
26 alias: {
27 "@": path.resolve(__dirname, "./src"),
28 },
29 },
30 base: '/',
31 build: {
32 outDir: 'dist',
33 assetsDir: 'assets',
34 },
35 }
36})