$ErrorActionPreference = "Stop" $projectRoot = [System.IO.Path]::GetFullPath((Split-Path -Parent $PSScriptRoot)) Push-Location $projectRoot try { & npm run typecheck if ($LASTEXITCODE -ne 0) { throw "TypeScript encontró errores." } & npm exec vite build if ($LASTEXITCODE -ne 0) { throw "Vite no pudo compilar la aplicación." } Write-Host "GLM Hub compilado en $(Join-Path $projectRoot 'dist')" } finally { Pop-Location }