<# .SYNOPSIS Builds vid.stab (LGPL-2.1-or-later) to WebAssembly in Docker and copies it to frontend/vendor/local/vidstab@1/, where the site serves it from /vendor/. vid.stab is pinned by commit in the Dockerfile; these build files are published at /source/vidstab/. Nothing is installed on this machine; Docker Desktop must be running. #> $ErrorActionPreference = 'Continue' Set-Location $PSScriptRoot $dist = Join-Path $PSScriptRoot 'dist' if (Test-Path $dist) { Remove-Item -Recurse -Force $dist } & docker build --target export --output "type=local,dest=$dist" . if ($LASTEXITCODE -ne 0) { throw 'docker build failed' } $dest = Join-Path $PSScriptRoot '..\..\vendor\local\vidstab@1' New-Item -ItemType Directory -Force $dest | Out-Null foreach ($f in 'vidstab.mjs', 'vidstab.wasm', 'COPYING.LESSER') { Copy-Item (Join-Path $dist $f) $dest -Force } Get-ChildItem $dest | Select-Object Name, Length | Out-String | Write-Host