Swallow.MSBuild.Node 0.1.0

dotnet add package Swallow.MSBuild.Node --version 0.1.0
                    
NuGet\Install-Package Swallow.MSBuild.Node -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Swallow.MSBuild.Node" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Swallow.MSBuild.Node" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Swallow.MSBuild.Node" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Swallow.MSBuild.Node --version 0.1.0
                    
#r "nuget: Swallow.MSBuild.Node, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Swallow.MSBuild.Node@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Swallow.MSBuild.Node&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Swallow.MSBuild.Node&version=0.1.0
                    
Install as a Cake Tool

Swallow.MSBuild.Node

An MSBuild adapter to run npm run build in dotnet build and include the resulting files as static assets.

Installation

Add a package reference to Swallow.MSBuild.Node, but be sure to include the assets only for building:

<PackageReference Include="Swallow.MSBuild.Node" Version="0.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>build</IncludeAssets>
</PackageReference>

After that, once you've got a package.json in the root of your project, MSBuild will...

  • Run npm install on a dotnet restore (if needed)
  • Run npm run build on a dotnet build (if needed)
  • Run npm run clean on a dotnet clean

If the build or clean scrpt is not defined, it will just not run anything. All scripts will be executed with $OUT_DIR set to the target directory; if you write to any file, be sure to pass that environment variable to any tooling. Otherwise, the resulting output will not be included as static asset.

Configuring

Swallow.MSBuild.Node can be configured in a number of ways. Shown is the default value for every property:

<PropertyGroup>
  
  <FrontendCompilePatterns>*.js;*.jsx;*.ts;*.tsx</FrontendCompilePatterns>

  
  <ExcludeWwwRoot>true</ExcludeWwwRoot>
  <FrontendCompileExcludes Condition="$(ExcludeWwwRoot) == 'true'">wwwroot/**/*</FrontendCompileExcludes>

  
  <FrontendRootPath>$(MSBuildProjectDirectory)/</FrontendRootPath>

  
  <BuildToolPath>npm</BuildToolPath>

  
  <BuildScriptName>build</BuildScriptName>

  
  <CleanScriptName>clean</CleanScriptName>
</PropertyGroup>
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 30 4/12/2026