ESBuild.MSBuild
0.19.5.38
dotnet add package ESBuild.MSBuild --version 0.19.5.38
NuGet\Install-Package ESBuild.MSBuild -Version 0.19.5.38
<PackageReference Include="ESBuild.MSBuild" Version="0.19.5.38" />
<PackageVersion Include="ESBuild.MSBuild" Version="0.19.5.38" />
<PackageReference Include="ESBuild.MSBuild" />
paket add ESBuild.MSBuild --version 0.19.5.38
#r "nuget: ESBuild.MSBuild, 0.19.5.38"
#addin nuget:?package=ESBuild.MSBuild&version=0.19.5.38
#tool nuget:?package=ESBuild.MSBuild&version=0.19.5.38
(ES|MS)Build
ESBuild.MSBuild
is a NuGet package which wraps esbuild, enabling frontend builds without Node or NPM.
Usage
Add a package reference and ESBuild
items to your csproj. Each entry point will be bundled and converted into a Content
item, which will be published and (if you are using ASP.NET Core) included as a static web asset, accessible at _content/<Your.Project.Name>/<bundle.name>
. Example:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ESBuild.MSBuild" Version="0.19.5.*" />
<ESBuild Include="index.ts" Minify="true" />
<ESBuild Include="app.css" />
<ESBuild Include="global/*.css" Group="global.css" />
</ItemGroup>
</Project>
API
For more complex scenarios, these MSBuild properties are available.
Property | Default | Description | Purpose |
---|---|---|---|
ESBuildBinaryPath |
Platform-specific. | Location of esbuild or esbuild.exe . |
For low-level integration - use it to run esbuild yourself, or change it to run a custom version. |
ESBuildEcho |
False |
Whether to log esbuild invocations. | Set to true to display generated commandlines. |
ESBuildIntermediatePath |
obj/$(Configuration)/esbuild/ |
Location to write generated bundles. | Can be changed if you want to store the bundles or distribute them out-of-band. |
ESBuildWebRoot |
wwwroot/ |
Virtual path of generated Content items. | Provides static web assets integration and the output path used for dotnet publish . |
Bundling can be configured with properties or item metadata
Global property | Item metadata | Default | Description |
---|---|---|---|
n/a | Group |
None. | ESBuild items with the same Group will be concatenated together before bundling. |
ESBuildArguments |
Arguments |
None. | Overrides all other config. (See esbuild docs.) |
ESBuildBundle |
Bundle |
True |
Inline any imported dependencies into the output file. |
ESBuildExternals |
Externals |
None | Semicolon-separated list of external packages that don't require resolution. |
ESBuildFormat |
Format |
Automatic. | iife , esm or cjs . |
ESBuildMinify |
Minify |
True in Release configuration. |
Rewrite syntax to be more compact. Takes advantage of all features allowed by Targets. |
ESBuildPlatform |
Platform |
browser |
browser , node or neutral . |
ESBuildTargets |
Targets |
esnext |
Semicolon-separated list of required support levels. (Unlike --targets , which is comma-separated). |
ESBuildTreeShaking |
TreeShaking |
Automatic. | True to force-enable or False to force-disable dead code elimination. |
Platforms
The package contains esbuild binaries for MacOS, Windows and Linux (glibc), on AMD64 and ARM64.
Versions
The first three digits of the package version are the version of the included esbuild, and the fourth digit is the package build number.
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.19.5.38 | 722 | 11/7/2023 |
0.19.4.35 | 336 | 10/12/2023 |
0.19.4.33 | 294 | 10/12/2023 |
0.19.4.31 | 309 | 10/10/2023 |
0.19.4.29 | 273 | 10/10/2023 |
0.19.4.27 | 338 | 10/10/2023 |
0.19.4.23 | 335 | 10/9/2023 |
0.19.4.21 | 334 | 10/8/2023 |
0.19.4.17 | 270 | 10/8/2023 |
0.19.4.14 | 293 | 10/8/2023 |
0.19.4.10 | 335 | 10/7/2023 |
0.19.4.8 | 283 | 10/7/2023 |
0.19.4.5 | 294 | 10/7/2023 |
0.19.4 | 295 | 10/7/2023 |