<# .SYNOPSIS Builds the WOFF2 codec (woff2, brotli) to WebAssembly in Docker and copies it to frontend/vendor/local/woff2@1/, where the site serves it from /vendor/. The libraries are pinned by commit in the Dockerfile; these build files are published at /source/woff2/. 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\woff2@1' New-Item -ItemType Directory -Force $dest | Out-Null Copy-Item (Join-Path $dist 'woff2.mjs') $dest -Force Copy-Item (Join-Path $dist 'woff2.wasm') $dest -Force Get-ChildItem $dest | Select-Object Name, Length | Out-String | Write-Host