Created
April 8, 2020 11:58
-
-
Save murbanowicz/dcf97f5b570a2f016b4a510cf4c37f9c to your computer and use it in GitHub Desktop.
React SPA Net Core
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PropertyGroup> | |
<TargetFramework>netcoreapp3.1</TargetFramework> | |
<SpaRoot>frontend\</SpaRoot> | |
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes> | |
</PropertyGroup> | |
<ItemGroup> | |
<None Update="app.db" CopyToOutputDirectory="PreserveNewest" ExcludeFromSingleFile="true"/> | |
</ItemGroup> | |
<ItemGroup> | |
<!-- Don't publish the SPA source files, but do show them in the project files list --> | |
<Content Remove="$(SpaRoot)**"/> | |
<None Remove="$(SpaRoot)**"/> | |
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**"/> | |
</ItemGroup> | |
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish"> | |
<!-- As part of publishing, ensure the JS resources are freshly built in production mode --> | |
<!-- Customize these command as needed --> | |
<Exec WorkingDirectory="$(SpaRoot)" Command="yarn"/> | |
<Exec WorkingDirectory="$(SpaRoot)" Command="yarn build"/> | |
<!-- Include the newly-built files in the publish output --> | |
<ItemGroup> | |
<DistFiles Include="$(SpaRoot)build\**"/> | |
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)"> | |
<RelativePath>%(DistFiles.Identity)</RelativePath> | |
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | |
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> | |
</ResolvedFileToPublish> | |
</ItemGroup> | |
</Target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment