-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDotnet.Web.Nuxt.csproj
53 lines (45 loc) · 2.35 KB
/
Dotnet.Web.Nuxt.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
46
47
48
49
50
51
52
53
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- Spa configuration -->
<PropertyGroup>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<IsPackable>false</IsPackable>
<SpaRoot>ClientApp\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<SpaProxyServerUrl>https://localhost:3000</SpaProxyServerUrl>
<SpaProxyLaunchCommand>pnpm dev</SpaProxyLaunchCommand>
</PropertyGroup>
<!-- Ensure the Spa dependencies are installed in development mode -->
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
<Message Importance="high" Text="Restoring dependencies using 'pnpm'."/>
<Exec WorkingDirectory="$(SpaRoot)" Command="pnpm install"/>
</Target>
<!-- Exclude the Spa folder and sources files from the output -->
<ItemGroup>
<Content Remove="$(SpaRoot)**"/>
<None Remove="$(SpaRoot)**"/>
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**"/>
</ItemGroup>
<!-- Set up the Spa build script when publishing -->
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
<Exec WorkingDirectory="$(SpaRoot)" Command="pnpm install --frozen-lockfile"/>
<Exec WorkingDirectory="$(SpaRoot)" Command="pnpm generate"/>
<!-- Include the dist files in the wwwroot directory -->
<ItemGroup>
<DistFiles Include="$(SpaRoot)dist\**"/>
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>wwwroot\%(RecursiveDir)%(FileName)%(Extension)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="8.0.6"/>
</ItemGroup>
</Project>