2026-11-02 17:38:34 +08:00
|
|
|
param(
|
|
|
|
|
[switch]$Dev,
|
|
|
|
|
[switch]$SkipBuild
|
|
|
|
|
)
|
|
|
|
|
|
2026-10-22 16:18:37 +08:00
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
|
$taskRoot = Split-Path -Parent $PSScriptRoot
|
|
|
|
|
Set-Location (Join-Path $taskRoot 'am-web')
|
2026-11-02 17:38:34 +08:00
|
|
|
if ($Dev) {
|
|
|
|
|
pnpm dev
|
|
|
|
|
} else {
|
|
|
|
|
if (-not $SkipBuild) {
|
|
|
|
|
pnpm build:local
|
|
|
|
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
|
|
|
}
|
|
|
|
|
# Same origin and port as development; preview inherits API/stream/WS proxy.
|
|
|
|
|
pnpm exec vite preview --mode env.local
|
|
|
|
|
}
|
2026-10-22 16:18:37 +08:00
|
|
|
exit $LASTEXITCODE
|