Skip to content

Commit 4f6558c

Browse files
committed
Ensure npm build happens before a publish.
1 parent 43f12df commit 4f6558c

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
2-
2+
33
<PropertyGroup>
44
<TargetFramework>net5</TargetFramework>
55
<TypeScriptToolsVersion>2.8</TypeScriptToolsVersion>
66
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
77
</PropertyGroup>
8-
8+
9+
<Target Name="Bundle" BeforeTargets="BeforePublish">
10+
<Exec Command="npm install --also=dev" />
11+
<Exec Command="npm run-script build" />
12+
</Target>
13+
914
<ItemGroup>
1015
<Folder Include="wwwroot\" />
1116
</ItemGroup>
12-
17+
1318
<ItemGroup>
1419
<PackageReference Include="ServiceStack" Version="5.*" />
1520
</ItemGroup>
16-
21+
1722
<ItemGroup>
1823
<ProjectReference Include="..\AureliaSpaTemplate.ServiceInterface\AureliaSpaTemplate.ServiceInterface.csproj" />
1924
<ProjectReference Include="..\AureliaSpaTemplate.ServiceModel\AureliaSpaTemplate.ServiceModel.csproj" />
2025
</ItemGroup>
21-
26+
2227
<Target Name="OnFirstUse" BeforeTargets="Build" Condition=" !Exists('wwwroot\dist') ">
2328
<Exec Command="node --version" ContinueOnError="true"><Output TaskParameter="ExitCode" PropertyName="ErrorCode" /></Exec>
2429
<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." />
2530
</Target>
2631

27-
</Project>
32+
</Project>

0 commit comments

Comments
 (0)