Skip to content
Mads Kristensen edited this page Jun 8, 2016 · 43 revisions

Welcome to the BundlerMinifier wiki!

Documentation on bundleconfig.json

Usage

The Bundler & Minifier consists can be used in a variety of ways:

Visual Studio

For Visual Studio 2015 users it is highly recommended to use the free Bundler & Minifier extension.

For more info on the Visual Studio extension, check out the readme page.

Visual Studio Code

To use this tool in Visual Studio Code, you first need to install it in project.json. See Command Line Interface for details.

When installation in project.json is done, you are ready to setup the tasks.

Setup tasks in tasks.json

{
    "version": "0.1.0",
    "command": "dotnet",
    "options": {
        // Make sure this points to the directory containing project.json
        "cwd": "${workspaceRoot}/src/bundlertest"
    },
    "isShellCommand": true,
    "showOutput": "always",
    "tasks": [
        {
            "taskName": "build",
            "isBuildCommand": true
        },
        {
            "taskName": "bundle"
        },
        {
            "taskName": "clean",
            "args": [ "bundle", "clean" ],
            "suppressTaskName": true
        },
        {
            "taskName": "watch",
            "args": [ "bundle", "watch" ],
            "suppressTaskName": true,
            "isWatching": true
        }
    ]
}

After configuring tasks.json you can now invoke the command bar (F1) and access the taks.

VSCode Command bar

Running the bundle task will produce output like this:

Running with configuration from c:\Users\name\Projects\MyApp\src\MyApp\bundleconfig.json
Processing wwwroot/css/site.min.css
  Bundled
  Minified
Processing wwwroot/js/site.min.js
  Bundled
  Minified

Command Line Interface (.NET Core)

The CLI tool must be installed into project.json to make it available.

"tools": {
  "BundlerMinifier.Core": {
    "version": "2.*",
    "imports": [
      "portable-net45+win8+dnxcore50",
      "portable-net40+sl5+win8+wp8+wpa81"
    ]
  }
}

dotnet bundle

dotnet bundle clean

dotnet bundle watch

ASP.NET Helpers

Clone this wiki locally