const fs = require('fs'); const path = require('path'); // Copy .htaccess from public to out directory after build const source = path.join(__dirname, '..', 'public', '.htaccess'); const destination = path.join(__dirname, '..', 'out', '.htaccess'); try { if (fs.existsSync(source)) { fs.copyFileSync(source, destination); console.log('✓ .htaccess copied to out directory'); } else { console.warn('⚠ .htaccess not found in public directory'); } } catch (error) { console.error('Error copying .htaccess:', error.message); process.exit(1); }