#!/usr/bin/env node
/**
 * Build the client (frontend) from the backend directory.
 * Uses Vite API directly to avoid npx resolution issues.
 */
import path from 'path';
import { fileURLToPath } from 'url';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const clientDir = path.join(__dirname, '..', 'client');

// Change cwd so Vite/Tailwind resolve configs from client/
process.chdir(clientDir);
console.log(`Building client from: ${clientDir}`);

const { build } = await import('vite');
await build();
