BundlerMinifier.Core.Tool
7.1.2
See the version list below for details.
dotnet tool install --global BundlerMinifier.Core.Tool --version 7.1.2
dotnet new tool-manifest
dotnet tool install --local BundlerMinifier.Core.Tool --version 7.1.2
#tool dotnet:?package=BundlerMinifier.Core.Tool&version=7.1.2
nuke :add-package BundlerMinifier.Core.Tool --version 7.1.2
Bundler and Minifier
A .NET Core tool that let's you configure bundling and minification of JS, CSS and HTML files. This is a simplified fork of https://github.com/madskristensen/BundlerMinifier that is kept more up-to-date with NUglify and implements some missing features. It has been repackaged into a .NET Core tool.
GitHub actions have been setup such that new NuGet releases of NUglify will automatically trigger a release and publish of this tool with an incremented version number, so this tool should track NUglify fairly closely. Enjoy! 👍
Install it by running dotnet tool install BundlerMinifier.Core.Tool
Invoke it by calling dotnet tool run bundle.
Features
- Bundles CSS, JavaScript or HTML files into a single output file
- Support for globbing patterns
- Minify individual or bundled CSS, JavaScript and HTML files
- Minification options for each language is customizable
- Command line support
- Shortcut to update all bundles in solution
- Suppress output file generation
- Support NUglify killSwitch and ignoreErrorList directives for each bundle.
- A bundle can refer to the output file path of another bundle to include its input files (supports recursion).
- Bundles are processed in parallel for a faster build.
A note about encoding
All files without a BOM (Byte Order Mark) is treated as UTF-8. If you see strange characters in the output bundle files, you may want to consider saving the input files as UTF-8 or an encoding that lets you specify a BOM.
bundleconfig.json
Create a bundleconfig.json file at the root of the
project which is used to configure all bundling.
Here's an example of what that file looks like:
[
{
"outputFileName": "output/bundle.css",
"inputFiles": [
"css/lib/**/*.css", // globbing patterns are supported
"css/input/site.css"
],
"minify": {
"enabled": true,
"commentMode": "all",
"renameLocals": true,
"ignoreErrorList": "JS1292,JS1315",
"gzip": true
}
},
{
"outputFileName": "output/all.js",
"inputFiles": [
"js/*.js",
"!js/ignore.js" // start with a ! to exclude files
]
},
{
"outputFileName": "output/app.js",
"inputFiles": [
"input/main.js",
"input/core/*.js" // all .js files in input/core/
]
}
]
There are some additional values that are possible in the minify section, see src/BundlerMinifier.Core/Minify/JavaScriptOptions.cs and src/BundlerMinifier.Core/Minify/CssOptions.cs for the complete list.
Contribute
Check out the contribution guidelines if you want to contribute to this project.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.6.5 | 2,497 | 7/29/2025 |
| 7.6.4 | 6,159 | 4/7/2025 |
| 7.6.3 | 274 | 3/31/2025 |
| 7.6.2 | 1,274 | 2/27/2025 |
| 7.6.1 | 815 | 2/22/2025 |
| 7.6.0 | 2,273 | 12/20/2024 |
| 7.5.3 | 337 | 12/10/2024 |
| 7.5.2 | 2,267 | 11/4/2024 |
| 7.5.1 | 17,145 | 6/25/2024 |
| 7.4.1 | 229 | 6/24/2024 |
| 7.4.0 | 407 | 6/21/2024 |
| 7.1.2 | 401 | 6/11/2024 |
| 7.1.1 | 1,268 | 4/24/2024 |
| 7.1.0 | 2,141 | 2/28/2024 |
| 7.0.3 | 19,503 | 2/5/2024 |
| 7.0.2 | 214 | 2/4/2024 |
| 7.0.1 | 1,828 | 12/16/2023 |
| 7.0.0 | 3,726 | 11/14/2023 |
| 6.1.1 | 1,602 | 10/6/2023 |
| 6.1.0 | 6,739 | 7/10/2023 |
| 6.0.2 | 260 | 7/9/2023 |
| 6.0.1 | 282 | 7/9/2023 |
| 6.0.0 | 320 | 7/9/2023 |
| 5.0.8 | 1,341 | 6/5/2023 |
| 5.0.4 | 2,726 | 5/11/2023 |
| 5.0.3 | 1,044 | 4/4/2023 |
| 5.0.2 | 2,339 | 1/26/2023 |
| 5.0.1 | 1,095 | 12/13/2022 |
| 5.0.0 | 510 | 12/11/2022 |
| 4.5.17 | 1,364 | 11/23/2022 |
| 4.5.16 | 7,889 | 7/21/2022 |
| 4.5.15 | 9,424 | 4/8/2022 |
| 4.5.14 | 568 | 4/1/2022 |
| 4.5.13 | 633 | 3/30/2022 |
| 4.5.12 | 1,761 | 3/16/2022 |
| 4.5.11 | 575 | 3/16/2022 |
| 4.5.10 | 685 | 3/8/2022 |
| 4.5.9 | 552 | 3/8/2022 |
| 4.5.8 | 3,600 | 1/24/2022 |
| 4.5.7 | 1,428 | 1/14/2022 |
| 4.5.6 | 608 | 1/14/2022 |
| 4.5.5 | 3,109 | 1/13/2022 |
| 4.5.4 | 592 | 1/10/2022 |
| 4.5.3 | 673 | 12/17/2021 |
| 4.5.2 | 3,690 | 12/14/2021 |
| 4.5.1 | 438 | 12/14/2021 |
| 4.5.0 | 1,255 | 11/29/2021 |
| 4.4.12 | 1,283 | 11/21/2021 |
| 4.4.11 | 1,224 | 10/8/2021 |
| 4.4.9 | 524 | 10/5/2021 |
| 4.4.8 | 1,883 | 9/1/2021 |
| 4.4.6 | 624 | 8/22/2021 |
| 4.4.5 | 492 | 8/20/2021 |
| 4.4.4 | 563 | 8/18/2021 |
| 4.4.3 | 1,970 | 8/14/2021 |
| 4.4.2 | 510 | 8/13/2021 |
| 4.4.1 | 500 | 8/11/2021 |
| 4.4.0 | 467 | 8/4/2021 |
| 4.3.2 | 667 | 7/25/2021 |
| 4.3.1 | 568 | 7/24/2021 |
| 4.3.0 | 4,142 | 5/2/2021 |
| 4.2.0 | 635 | 3/21/2021 |
| 4.1.1 | 730 | 12/31/2020 |
| 4.1.0 | 552 | 12/29/2020 |
| 4.0.0 | 647 | 12/28/2020 |