by madskristensen

madskristensen / BundlerMinifier

Visual Studio extension

479 Stars 121 Forks Last release: Not found Other 438 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Bundler and Minifier

A Visual Studio extension that let's you configure bundling and minification of JS, CSS and HTML files.

Build status NuGet

Download the extension at the VS Gallery or get the nightly build

See the changelog for changes and roadmap and the wiki for more details.


  • Bundles CSS, JavaScript or HTML files into a single output file
  • Saving a source file triggers re-bundling automatically
  • Support for globbing patterns
  • MSBuild support for CI scenarios supported
  • Minify individual or bundled CSS, JavaScript and HTML files
  • Minification options for each language is customizable
  • Shows a watermark when opening a generated file
  • Task Runner Explorer integration
  • Command line support
  • Shortcut to update all bundles in solution
  • Suppress output file generation
  • Convert to Gulp

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.


Select 2 or more of the same type of files in Solution Explorer to create a bundle.

Create bundle

Any edits being made to the source files will instantly produce updated bundle file output.

The bundle configuration is stored in a file called

which gets added to the root of the project.


Minify any JS, CSS or HTML file by right-clicking it in Solution Explorer. That will create a [filename].min.[ext] and nest it under the original file.

Minify file

When the original file is modified, a new min file is produced instantly.

Bundle on build / CI support

In ASP.NET MVC and WebForms projects you can enable bundling and minification as part of the build step. Simply right-click the

file to enable it.

Bundle on build

Clicking the menu item will prompt you with information about what will happen if you click the OK button.

Bundle on build prompt

A NuGet package will be installed into the

folder without adding any files to the project itself. That NuGet package contains an MSBuild task that will run the exact same compilers on the
file in the root of the project.

For ASP.NET Core projects, see the wiki

Update all bundles

You can run the bundler on all

files in the solution by using the keyboard shortcut
or by using the button on the top level Build menu.

Update all bundles

Source maps

Source maps are supported for JavaScript minification only at this time.


file is produced next to the
file automatically, but if you manually delete the
file, a new one will not be created on subsequent minifications.

To enable source maps, add this property to the

"sourceMap": true

Task Runner Explorer

Get a quick overview of the files you've specified or execute a bundle directly in Task Runner Explorer.

Task Runner Explorer

You can even set bindings so that bundling/minification happens automatically during certain Visual Studio events, such as BeforeBuild and Project Open.

Task Runner Bindings

Suppress output file generation

There are cases when you don't want the extension to listen for file changes and generate bundled and minified output. That could be if you want to use Gulp to use

or server-side code instead. In those cases it will still be helpful to have the
file with all the Visual Studio tooling around it, but let other tools handle the bundling and minification process.

To suppress the output, remove the checkbox located in the right-click menu of


Suppress output

Convert to Gulp

This feature makes it easy to start using Gulp based on what's already configured in

. It will create
if they don't already exist and then install the needed node modules using npm.


will consume
to get the input and output file paths, but will use regular gulp plugins to do all the bundling and minification. You can modify it to use other plugins without losing its ability to read the

Read more about this and see code samples on the wiki.


The extension adds a

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
    "minify": {
        "enabled": true,
        "commentMode": "all"
    "outputFileName": "output/all.js",
    "inputFiles": [
      "!js/ignore.js" // start with a ! to exclude files
    "outputFileName": "output/app.js",
    "inputFiles": [
      "input/core/*.js" // all .js files in input/core/


Check out the contribution guidelines if you want to contribute to this project.

For cloning and building this project yourself, make sure to install the Extensibility Tools extension for Visual Studio which enables some features used by this project.


Apache 2.0

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.