-
Notifications
You must be signed in to change notification settings - Fork 1
/
aspnet_hotwire.csproj
45 lines (37 loc) · 1.71 KB
/
aspnet_hotwire.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
38
39
40
41
42
43
44
45
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ClientAppFolder>ClientApp\</ClientAppFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="6.0.16" />
</ItemGroup>
<ItemGroup>
<!-- Don't publish the SPA source files, but do show them in the project files list -->
<Content Remove="$(ClientAppFolder)**" />
</ItemGroup>
<ItemGroup>
<Folder Include="ClientApp\public\" />
</ItemGroup>
<ItemGroup>
<None Include="wwwroot\img\vite.svg" />
</ItemGroup>
<Target Name="EnsureNodeModules" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(ClientAppFolder)\node_modules') ">
<Message Importance="high" Text="Restoring dependencies using 'pnpm'. This may take several minutes..." />
<Exec WorkingDirectory="$(ClientAppFolder)" Command="pnpm install" />
</Target>
<Target Name="BuildClientAssets" AfterTargets="ComputeFilesToPublish">
<Exec WorkingDirectory="$(ClientAppFolder)" Command="pnpm install" />
<Exec WorkingDirectory="$(ClientAppFolder)" Command="pnpm run build" />
<ItemGroup>
<DistFiles Include="wwwroot\dist\**" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>