posts are done

This commit is contained in:
2026-05-19 00:08:02 +02:00
parent 202ce22102
commit 2e9e3ed41b
35 changed files with 1528 additions and 272 deletions

View File

@@ -1,17 +1,53 @@
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
plugins: [
react(),
tailwindcss()
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const backendUrl = env.VITE_BACKEND_URL || '';
return {
plugins: [
tailwindcss(),
react({
babel: {
plugins: [['babel-plugin-react-compiler']],
},
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
// Force single React instance to avoid duplicate React errors with @yudiel/react-qr-scanner
'react': path.resolve(__dirname, './node_modules/react'),
'react-dom': path.resolve(__dirname, './node_modules/react-dom'),
},
},
},
build: {
target: 'es2020',
},
server: {
proxy: {
'/api': {
target: backendUrl,
changeOrigin: true,
},
'/static': {
target: backendUrl,
changeOrigin: true,
},
'/media': {
target: backendUrl,
changeOrigin: true,
},
'/ws': {
target: backendUrl,
ws: true,
changeOrigin: true,
},
},
},
};
})