<# .SYNOPSIS Builds aacscan (FFmpeg 5.1.6's AAC decoder, with src/aacscan.c) to WebAssembly in Docker and copies it to frontend/vendor/local/aacscan@1/, where the site serves it from /vendor/. The build runs from wasm-src/ so it uses the FFmpeg tarball already kept (and published) in wasm-src/ffmpeg/source/. Nothing is installed on this machine; Docker Desktop must be running. #> $ErrorActionPreference = 'Continue' $root = Split-Path $PSScriptRoot -Parent Set-Location $root $dist = Join-Path $PSScriptRoot 'dist' if (Test-Path $dist) { Remove-Item -Recurse -Force $dist } & docker build -f aacscan/Dockerfile --target export --output "type=local,dest=$dist" . if ($LASTEXITCODE -ne 0) { throw 'docker build failed' } $dest = Join-Path $root '..\vendor\local\aacscan@1' New-Item -ItemType Directory -Force $dest | Out-Null Copy-Item (Join-Path $dist 'aacscan.mjs') $dest -Force Copy-Item (Join-Path $dist 'aacscan.wasm') $dest -Force Get-ChildItem $dest | Format-Table Name, Length