31 lines
792 B
TypeScript
31 lines
792 B
TypeScript
import { fileURLToPath } from 'node:url';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { defineConfig } from 'vite';
|
|
|
|
const api = process.env.API_ORIGIN ?? 'http://localhost:3726';
|
|
|
|
export default defineConfig({
|
|
root: 'web',
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@shared': fileURLToPath(new URL('./shared', import.meta.url)),
|
|
'@': fileURLToPath(new URL('./web/src', import.meta.url)),
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
strictPort: false,
|
|
proxy: {
|
|
'/api': { target: api, changeOrigin: false },
|
|
'/media': { target: api, changeOrigin: false },
|
|
},
|
|
},
|
|
build: {
|
|
outDir: '../dist/web',
|
|
emptyOutDir: true,
|
|
sourcemap: false,
|
|
chunkSizeWarningLimit: 900,
|
|
},
|
|
});
|