Build Better Gulpfiles

asset-builder assembles and orchestrates your dependencies so you can run them through your asset pipeline. Easily create gulp tasks you can share between projects by separating config from code.

GitHub Repo

npm version Coverage Status

asset-builder allows you to declare the output of your Gulpfile in an external manifest file.

manifest.json

{
  "dependencies": {
    "app.js": {
      "files": [
        "scripts/services/**/*.js",
        "scripts/controllers.js",
        "scripts/main.js"
      ],
      "main": true
    }
  }
}

So you can stop doing this...

gulpfile.js

gulp.src([
  'bower_components/jquery/jquery.js',
  'bower_components/bootstrap/component.js',
  'scripts/services/**/*.js',
  'scripts/controllers.js',
  'scripts/main.js'
])
  .pipe(concat('app.js'))
  .pipe(minify())
  .pipe(gulp.dest('dist'));

...and start doing this

gulpfile.js

gulp.src(js.globs)
  .pipe(concat(js.name))
  .pipe(minify())
  .pipe(gulp.dest(manifest.paths.dist));

Install

npm install asset-builder --save-dev