50 lines
1.7 KiB
XML
50 lines
1.7 KiB
XML
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
|
|
<PropertyGroup>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<Nullable>disable</Nullable>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
<OutputType>Exe</OutputType>
|
|
<UseAppHost>false</UseAppHost>
|
|
<PublishReadyToRun>true</PublishReadyToRun>
|
|
<SpaRoot>Source\</SpaRoot>
|
|
<FrontendStampFile>$(BaseIntermediateOutputPath)$(Configuration)\frontend_build.stamp</FrontendStampFile>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<Content Remove="Source\*.json" />
|
|
<Content Remove="wwwroot\dist\**" />
|
|
<None Include="Source\*.json" />
|
|
<None Update="Templates\**">
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
</None>
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<FrontendInputs Include="$(SpaRoot)src\**"/>
|
|
<FrontendInputs Include="$(SpaRoot)*.ts"/>
|
|
<FrontendInputs Include="$(SpaRoot)package.json"/>
|
|
</ItemGroup>
|
|
|
|
<Target Name="BuildFrontend" BeforeTargets="BeforeBuild"
|
|
Inputs="@(FrontendInputs)" Outputs="$(FrontendStampFile)">
|
|
<Message Importance="high" Text="Changes detected. Running npm run build..." />
|
|
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build" />
|
|
<Touch Files="$(FrontendStampFile)" AlwaysCreate="true" />
|
|
<ItemGroup>
|
|
<ResolvedFileToPublish Include="$(MSBuildProjectDirectory)\wwwroot\dist\.vite\manifest.json">
|
|
<RelativePath>Templates\manifest.json</RelativePath>
|
|
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
|
|
</ResolvedFileToPublish>
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="BeforeStaticWebAssets" BeforeTargets="ResolveProjectStaticWebAssets">
|
|
<ItemGroup>
|
|
<Content Include="wwwroot\dist\**" />
|
|
<Content Remove="wwwroot\dist\.vite\**" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
</Project>
|