【发布时间】:2018-03-04 07:44:11
【问题描述】:
我有一个 ASP.NET Core 2.0 应用程序和 Angular 5 SPA 托管在同一个文件夹中。
目前要部署到 IIS,我执行以下操作:
// First publish the release configuration
dotnet publish -c release
// Now delete the wwwroot directory as it is pulished with ng build
rm -r bin/release/netcoreapp2.0/publish/wwwroot
// Build the prod version of the angular app
ng build --prod
// copy the new wwwroot folder into the publish folder
cp -R wwwroot bin/release/netcoreapp2.0/publish/
这非常令人困惑......我如何告诉 dotnet publish 运行 ng build --prod?
我已尝试将以下内容添加到我的项目 csproj 文件中:
<Target Name="AngularBuild" AfterTargets="Publish">
<Exec Command="npm run build --prod" />
</Target>
【问题讨论】:
标签: angular asp.net-core visual-studio-code dotnet-cli