feat(frontend): add react spa with wishlist flows and public profile

This commit is contained in:
Anton
2026-04-23 16:05:27 +03:00
parent 5f6a551b6c
commit 00f01611ed
44 changed files with 2166 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'node:path';
import { readFileSync } from 'node:fs';
const pkg = JSON.parse(readFileSync(path.resolve(__dirname, 'package.json'), 'utf-8')) as {
version: string;
};
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const apiTarget = env.VITE_API_TARGET ?? 'http://localhost:3000';
return {
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
define: {
__FRONTEND_VERSION__: JSON.stringify(pkg.version),
},
server: {
port: 5173,
proxy: {
'/api': { target: apiTarget, changeOrigin: true },
'/uploads': { target: apiTarget, changeOrigin: true },
},
},
build: {
outDir: 'dist',
sourcemap: true,
},
};
});