feat: automatically run vite dev server when in Debugger mode. feat: supports hotreload on both js frontend and .net backend.
38 lines
1.3 KiB
XML
38 lines
1.3 KiB
XML
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
|
|
<PropertyGroup>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<Nullable>disable</Nullable>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
<OutputType>Exe</OutputType>
|
|
<StaticWebAssetsEnabled>false</StaticWebAssetsEnabled>
|
|
<SpaRoot>Source\</SpaRoot>
|
|
<FrontendStampFile>$(BaseIntermediateOutputPath)$(Configuration)\frontend_build.stamp</FrontendStampFile>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<Content Remove="Source\*.json" />
|
|
<None Include="Source\*.json" />
|
|
<None Update="Templates\**\*.html">
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
</None>
|
|
<None Include="wwwroot\dist\.vite\manifest.json">
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
</None>
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<FrontendInputs Include="$(SpaRoot)src\**"/>
|
|
<FrontendInputs Include="$(SpaRoot)package.json"/>
|
|
<FrontendInputs Include="$(SpaRoot)vite.config.ts"/>
|
|
</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" />
|
|
</Target>
|
|
|
|
</Project>
|