31 lines
1.3 KiB
PowerShell
31 lines
1.3 KiB
PowerShell
|
|
#!/usr/bin/env pwsh
|
||
|
|
# 构建 P2/P3 前端
|
||
|
|
$ErrorActionPreference = "Stop"
|
||
|
|
|
||
|
|
# 设置 npm 镜像
|
||
|
|
$env:NPM_CONFIG_REGISTRY = "https://registry.npmmirror.com"
|
||
|
|
|
||
|
|
# 构建 frontend-agent
|
||
|
|
Write-Host "Building frontend-agent..."
|
||
|
|
Set-Location "D:\资料\03-项目开发\wecom_it_smart_desk\frontend-agent"
|
||
|
|
& "C:\Users\simon\.workbuddy\binaries\node\versions\22.22.2\node.exe" "C:\Users\simon\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" install
|
||
|
|
if ($LASTEXITCODE -ne 0) { throw "npm install failed" }
|
||
|
|
|
||
|
|
& "C:\Users\simon\.workbuddy\binaries\node\versions\22.22.2\node.exe" "C:\Users\simon\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" run build
|
||
|
|
if ($LASTEXITCODE -ne 0) { throw "npm run build failed" }
|
||
|
|
|
||
|
|
Write-Host "frontend-agent built successfully!"
|
||
|
|
|
||
|
|
# 构建 frontend-h5
|
||
|
|
Write-Host "Building frontend-h5..."
|
||
|
|
Set-Location "D:\资料\03-项目开发\wecom_it_smart_desk\frontend-h5"
|
||
|
|
& "C:\Users\simon\.workbuddy\binaries\node\versions\22.22.2\node.exe" "C:\Users\simon\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" install
|
||
|
|
if ($LASTEXITCODE -ne 0) { throw "npm install failed" }
|
||
|
|
|
||
|
|
& "C:\Users\simon\.workbuddy\binaries\node\versions\22.22.2\node.exe" "C:\Users\simon\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" run build
|
||
|
|
if ($LASTEXITCODE -ne 0) { throw "npm run build failed" }
|
||
|
|
|
||
|
|
Write-Host "frontend-h5 built successfully!"
|
||
|
|
|
||
|
|
Write-Host "All done!"
|