<# .SYNOPSIS Builds libwps and librevenge to WebAssembly in Docker and copies the module to frontend/vendor/local/wps@1/, where the site serves it from /vendor/. These files are published at /source/wps/; the library sources are the release tarballs named (with SHA-256) in the Dockerfile. 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\wps@1' New-Item -ItemType Directory -Force $dest | Out-Null Copy-Item (Join-Path $dist 'wps.mjs') $dest -Force Copy-Item (Join-Path $dist 'wps.wasm') $dest -Force Get-ChildItem $dest | Select-Object Name, Length | Out-String | Write-Host