mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
59 lines
3.1 KiB
XML
59 lines
3.1 KiB
XML
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
|
|
<PropertyGroup>
|
|
<TargetFramework Condition="'$(TargetFrameworkOverride)' == ''">netcoreapp2.0</TargetFramework>
|
|
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework>
|
|
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
|
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
|
|
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
|
<IsPackable>false</IsPackable>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">
|
|
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-preview2-25571" />
|
|
</ItemGroup>
|
|
<ItemGroup Condition="'$(TargetFrameworkOverride)' != ''">
|
|
<PackageReference Include="NETStandard.Library.NETFramework" Version="2.0.0-preview2-25407-01" />
|
|
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0-preview2-25571" />
|
|
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0-preview2-25571" />
|
|
<PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="2.0.0-preview2-25571" />
|
|
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0-preview2-25571" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0-*" />
|
|
</ItemGroup>
|
|
|
|
<!--/-:cnd:noEmit -->
|
|
<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('wwwroot\dist') ">
|
|
<!-- Ensure Node.js is installed -->
|
|
<Exec Command="node --version" ContinueOnError="true">
|
|
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
|
|
</Exec>
|
|
<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." />
|
|
|
|
<!-- In development, the dist files won't exist on the first run or when cloning to
|
|
a different machine, so rebuild them if not already present. -->
|
|
<Message Importance="high" Text="Performing first-run Webpack build..." />
|
|
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js" />
|
|
<Exec Command="node node_modules/webpack/bin/webpack.js" />
|
|
</Target>
|
|
<!--/+:cnd:noEmit -->
|
|
|
|
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
|
|
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
|
|
<Exec Command="npm install" />
|
|
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" />
|
|
<Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" />
|
|
|
|
<!-- Include the newly-built files in the publish output -->
|
|
<ItemGroup>
|
|
<DistFiles Include="wwwroot\dist\**" />
|
|
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
|
|
<RelativePath>%(DistFiles.Identity)</RelativePath>
|
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
|
</ResolvedFileToPublish>
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
</Project> |