Skip to content

Commit

Permalink
🐛 Add conditions for publish run webpack task.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontaylordev committed Jun 26, 2023
1 parent c25fbef commit ed19244
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/WebUI/WebUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --configuration production" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --configuration production" Condition="'$(UseAngular)' != 'True'" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build" Condition="'$(UseReact)' != 'True'" />

<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" />
<DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" Condition="'$(UseAngular)' != 'True'" />
<DistFiles Include="$(SpaRoot)build\**" Condition="'$(UseReact)' != 'True'" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>wwwroot\%(RecursiveDir)%(FileName)%(Extension)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
Expand Down

0 comments on commit ed19244

Please sign in to comment.