Skip to content

Commit

Permalink
Only restore packages when needed
Browse files Browse the repository at this point in the history
Speed up local development iterations by only running `npm install` when the `node_modules` directory does not already exist.
  • Loading branch information
martincostello committed May 18, 2024
1 parent ecce973 commit a0f4bb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<Target Name="NpmInstall" BeforeTargets="DispatchToInnerBuilds">
<Target Name="NpmInstall" BeforeTargets="DispatchToInnerBuilds" Condition=" '$(CI)' != '' OR !Exists('$(MSBuildThisFileDirectory)\node_modules') ">
<Exec Command="npm install" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<Target Name="NpmInstall" BeforeTargets="DispatchToInnerBuilds">
<Target Name="NpmInstall" BeforeTargets="DispatchToInnerBuilds" Condition=" '$(CI)' != '' OR !Exists('$(MSBuildThisFileDirectory)\node_modules') ">
<Exec Command="npm install" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
Expand Down

0 comments on commit a0f4bb4

Please sign in to comment.