Skip to content
Mickael Daniel edited this page Jul 15, 2012 · 3 revisions

Task - mkdirs

The mkdirs task is working in tandem with the clean one, and creates the necessary build dirs.

// the staging directory used during the process
staging: 'intermediate/',

// final build output
output: 'publish/',

mkdirs: {
  staging: 'path/to/source'
},

We're using fstream-ignore to do the actual copy, and to support exclude pattern from either .gitignore, .buildignore or .ignore file. They work recursively, meaning that you can specify fils to exclude throughout your file tree, like you would do with git.

Helpers

mkdirs

mkdir helper is a basic wrapper for node-mkdirp. Takes a directory path to create, process is async if a valid callback is passed in, otherwise mkdirp.sync(dir) is used.

task.helper('mkdir', dir, cb);

copy

copy helper uses fstream-ignore to copy the files under the src (usually current directory) to the specified dest, optionnaly ignoring files specified by the ignores list of files.

It filters out files that match globs in .ignore files throughout the tree, like how git ignores files based on a .gitignore file.

This helper is asynchronous only. The whole stream "pipeline" of fstream- ignore is returned so that events mighh be listen to and furter streaming can be done, the result would be the final stream destination instance.

The task will "stream" the result of fstream.Ignore to dest, which might be a raw writable Stream, or a String in which case a new fstream.Writer is created automatically. If the dest string ends with .tar, then the copy is done by creating a new/single .tar file.

  • source - Path to the source directory.
  • dest - where the files will be copied to. Can be a String or a writable Stream. A new fstream.Writer (type directory) is created is dest is a String.
  • ignores - (optional) An Array of ignores files
  • cb - callback to call on completion
task.helper('copy', source, dest, opts, function(e) {
  if(e) log.error(e.stack || e.message);
  else log.ok();
  cb(!e);
});

» Home

» Tasks


» clean: Wipe the previous build dirs.

» mkdirs: Prepares the build dirs.

» concat: Concatenate files. (built-in)

» css: Concats, replaces @imports and minifies CSS files.

» min: Minify files using UglifyJS (built-in)

» rev: Automate the revving of assets and perform the hash rename

» usemin: Replaces references to non-minified scripts / stylesheets


» serve: Spawns up a basic local http server

» connect: livereload version of serve task

Clone this wiki locally