-
Notifications
You must be signed in to change notification settings - Fork 9
/
LeanAspNetCore.csproj
37 lines (29 loc) · 1.41 KB
/
LeanAspNetCore.csproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<ClientAppFolder>ClientApp</ClientAppFolder>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\dist\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.0" />
</ItemGroup>
<Target Name="EnsureNodeModules" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(ClientAppFolder)\node_modules') ">
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
<Exec WorkingDirectory="$(ClientAppFolder)" Command="npm install" />
</Target>
<Target Name="BuildClientAssets" AfterTargets="ComputeFilesToPublish">
<Exec WorkingDirectory="$(ClientAppFolder)" Command="npm install" />
<Exec WorkingDirectory="$(ClientAppFolder)" Command="npm run prod" />
<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="wwwroot\dist\**" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>