Ah - I am using Microsoft's "Angular" template. Although there's nothing explicitly defined in the CSPROJ's build events, the CSPROJ itself contains this markup:
Code:
...
<SpaRoot>ClientApp\</SpaRoot>
...
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
<!-- Ensure Node.js is installed -->
<Exec Command="yarn --version" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="Yarn and Node.js are required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and Yarn, and then restart your command prompt or IDE." />
<Message Importance="high" Text="Restoring dependencies using 'yarn'. This may take several minutes..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="yarn install" />
</Target>
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec WorkingDirectory="$(SpaRoot)" Command="yarn install --no-progress --non-interactive" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod --progress=false" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />
<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" />
<!--<DistFiles Include="$(SpaRoot)node_modules\**" Condition="'$(BuildServerSideRenderer)' == 'true'" />-->
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
Still, it shouldn't be executing either of these "targets". The first one only runs if there's no installed NPM packages (you run this only once when you first clone the project and it downloads the NPM packages from the internet). The second target only runs when you publish the project (the "npm run build" command compiles all typescript/javascript files and dependencies into a single javascript file among other things).
When I set the log verbosity to Detailed, the Processing Queue window log does show that it is running that second "target" which should only run when we publish the project (running msbuild /t:Publish)
Code:
...
Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
yarn --version
1.22.4
Task "Error" skipped, due to false condition; ('$(ErrorCode)' != '0') was evaluated as ('0' != '0').
Restoring dependencies using 'yarn'. This may take several minutes...
yarn install
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.2: The platform "win32" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.9: The platform "win32" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "codelyzer > axobject-query@2.1.1" has unmet peer dependency "eslint@^5 || ^6".
[4/4] Building fresh packages...
Done in 330.99s.
I can always comment it out, but I'm not sure how that would affect our pipelines.