A very performant and light (2mb in memory) link shortener and tracker. Written in Rust and React and uses Postgres/SQLite.
1import { defineConfig } from 'vite'
2import react from '@vitejs/plugin-react'
3import tailwindcss from '@tailwindcss/vite'
4import path from "path"
5
6export default defineConfig(({ command }) => {
7 if (command === 'serve') { //command == 'dev'
8 return {
9 server: {
10 proxy: {
11 '/api': {
12 target: process.env.VITE_API_URL || 'http://localhost:8080',
13 changeOrigin: true,
14 },
15 },
16 },
17 plugins: [react(), tailwindcss()],
18 resolve: {
19 alias: {
20 "@": path.resolve(__dirname, "./src"),
21 },
22 },
23 }
24 } else { //command === 'build'
25 return {
26 plugins: [react(), tailwindcss()],
27 resolve: {
28 alias: {
29 "@": path.resolve(__dirname, "./src"),
30 },
31 },
32 }
33 }
34})