Home

Awesome

NBundle

Easy to use SASS Compiler, CSS Bundler, CSS Minifier and JS Bunder.

Implemented as a dotnet tool which can be run in the following modes:

SASS Compiler converts to CSS and also runs an autoprefixer post-processor to automatically add vendor prefixes to CSS properties where needed. This ensures source files can use clean, minimal declarations. For example:

  user-select:none

compiles to:

  -webkit-user-select:none;
  -moz-user-select:none;
  -ms-user-select:none;
  user-select:none

Install Instructions

dotnet tool install -g NBundle

Usage Instructions

Example config file (default name: nbundle.json)

{
  "css": {
    "bundles": [
      {
        "destinationFilePath": "wwwroot/assets/css/bundle.css",
        "sourceFilePaths": [
          "Test/assets/scss/*.scss"
        ],
        "excludeSourceFilePaths": [
          "Test/assets/scss/do-not-include.scss"
        ],
        "minify": true,
        "commentPrefix": "AUTOGENERATED FILE - DO NOT EDIT",
        "addSourceFilePathComments": true
      }
    ]
  },
  "js": {
    "bundles": [
      {
        "destinationFilePath": "wwwroot/assets/js/bundle.js",
        "sourceFilePaths": [
          "Test/assets/js/*.js"
        ],
        "excludeSourceFilePaths": [
          "Test/assets/js/do-not-include.js"
        ],
        "minify": false,
        "commentPrefix": "AUTOGENERATED FILE - DO NOT EDIT",
        "addSourceFilePathComments": true
      }
    ]
  }
}

Warnings