source: Farmatiko/Farmatiko.csproj@ 4e72684

Last change on this file since 4e72684 was d2e69be, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago

Add Route Attribute

  • Property mode set to 100644
File size: 3.5 KB
Line 
1<Project Sdk="Microsoft.NET.Sdk.Web">
2
3 <PropertyGroup>
4 <TargetFramework>netcoreapp3.1</TargetFramework>
5 <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
6 <TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
7 <IsPackable>false</IsPackable>
8 <SpaRoot>ClientApp\</SpaRoot>
9 <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
10
11 <!-- Set this to true if you enable server-side prerendering -->
12 <BuildServerSideRenderer>false</BuildServerSideRenderer>
13 </PropertyGroup>
14
15 <ItemGroup>
16 <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.6" />
17 <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.6" />
18 <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.6">
19 <PrivateAssets>all</PrivateAssets>
20 <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
21 </PackageReference>
22 <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6">
23 <PrivateAssets>all</PrivateAssets>
24 <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25 </PackageReference>
26 <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
27 </ItemGroup>
28
29 <ItemGroup>
30 <!-- Don't publish the SPA source files, but do show them in the project files list -->
31 <Content Remove="$(SpaRoot)**" />
32 <None Remove="$(SpaRoot)**" />
33 <None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
34 </ItemGroup>
35
36 <ItemGroup>
37 <ProjectReference Include="..\FarmatikoData\FarmatikoData.csproj" />
38 <ProjectReference Include="..\FarmatikoServices\FarmatikoServices.csproj" />
39 </ItemGroup>
40
41 <Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
42 <!-- Ensure Node.js is installed -->
43 <Exec Command="node --version" ContinueOnError="true">
44 <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
45 </Exec>
46 <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
47 <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
48 <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
49 </Target>
50
51 <Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
52 <!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
53 <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
54 <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod" />
55 <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />
56
57 <!-- Include the newly-built files in the publish output -->
58 <ItemGroup>
59 <DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" />
60 <DistFiles Include="$(SpaRoot)node_modules\**" Condition="'$(BuildServerSideRenderer)' == 'true'" />
61 <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
62 <RelativePath>%(DistFiles.Identity)</RelativePath>
63 <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
64 <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
65 </ResolvedFileToPublish>
66 </ItemGroup>
67 </Target>
68
69</Project>
Note: See TracBrowser for help on using the repository browser.