Skip to content

Commit 0cd8ccf

Browse files
committed
Install WebSPA's npm dependencies before building
1 parent 9d7c588 commit 0cd8ccf

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

build-image-web-spa.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ $pubFolderToDelete = $scriptPath + "\pub"
66
remove-item -path $pubFolderToDelete -Force -Recurse -ErrorAction SilentlyContinue
77

88
# *** WebSPA image ***
9-
$webSPAPathToJson = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\project.json"
9+
$webSPAPath = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA"
10+
$webSPAPathToJson = $webSPAPath + "\project.json"
1011
Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow
1112
$webSPAPathToPub = $scriptPath + "\pub\webSPA"
12-
$webSPAPathToNpmBat = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\buildspa.bat"
1313
Write-Host "webSPAPathToPub is $webSPAPathToPub" -ForegroundColor Yellow
1414

15+
Write-Host "Installing npm dependencies"
16+
Start-Process -WorkingDirectory $webSPAPath -NoNewWindow -Wait npm i
17+
1518
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
1619
dotnet restore $webSPAPathToJson
1720
dotnet build $webSPAPathToJson
18-
# Start-Process "cmd.exe" "/c " + $webSPAPathToNpmBat
1921
dotnet publish $webSPAPathToJson -o $webSPAPathToPub
2022

2123
# *** identitySvc image ***

build-images.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@ dotnet build $webPathToJson
1717
dotnet publish $webPathToJson -o $webPathToPub
1818

1919
# *** WebSPA image ***
20-
$webSPAPathToJson = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\project.json"
20+
$webSPAPath = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA"
21+
$webSPAPathToJson = $webSPAPath + "\project.json"
2122
Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow
2223
$webSPAPathToPub = $scriptPath + "\pub\webSPA"
23-
$webSPAPathToNpmBat = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\buildspa.bat"
2424
Write-Host "webSPAPathToPub is $webSPAPathToPub" -ForegroundColor Yellow
2525

26+
Write-Host "Installing npm dependencies"
27+
Start-Process -WorkingDirectory $webSPAPath -NoNewWindow -Wait npm i
28+
2629
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
2730
dotnet restore $webSPAPathToJson
2831
dotnet build $webSPAPathToJson
29-
# Start-Process "cmd.exe" "/c " + $webSPAPathToNpmBat
3032
dotnet publish $webSPAPathToJson -o $webSPAPathToPub
3133

3234
# *** identitySvc image ***

0 commit comments

Comments
 (0)