-fs           = require 'fs'
-vfs          = require 'vinyl-fs'
-path         = require 'path'
-gloh         = require 'gloh'
-defined      = require 'defined'
-bant         = require 'bant'
-JSONStream   = require 'JSONStream'
-through      = require 'through2'
-coffeeify    = require 'coffeeify'
-pistachioify = require 'pistachioify'
-uglifyify    = require 'uglifyify'
-xtend        = require 'xtend'
-async        = require 'async'
-inspect      = require('util').inspect
-pretty       = require 'pretty-bytes'
-exorcist     = require 'exorcist'
-asStream     = require 'as-stream'
-notifier     = require 'node-notifier'
-mkdirp       = require 'mkdirp'
-nub          = require 'nub'
-spritesmith  = require 'gulp.spritesmith'
-chalk        = require 'chalk'
-chokidar     = require 'chokidar'
-events       = require 'events'
-nib          = require 'nib'
-stylus       = require 'gulp-stylus'
-concat       = require 'gulp-concat'
-throttle     = require 'throttleit'
+fs            = require 'fs'
+vfs           = require 'vinyl-fs'
+path          = require 'path'
+gloh          = require 'gloh'
+defined       = require 'defined'
+bant          = require 'bant'
+JSONStream    = require 'JSONStream'
+through       = require 'through2'
+coffeeify     = require 'coffeeify'
+pistachioify  = require 'pistachioify'
+uglifyify     = require 'uglifyify'
+xtend         = require 'xtend'
+async         = require 'async'
+inspect       = require('util').inspect
+pretty        = require 'pretty-bytes'
+exorcist      = require 'exorcist'
+asStream      = require 'as-stream'
+notifier      = require 'node-notifier'
+mkdirp        = require 'mkdirp'
+nub           = require 'nub'
+spritesmith   = require 'gulp.spritesmith'
+chalk         = require 'chalk'
+chokidar      = require 'chokidar'
+events        = require 'events'
+nib           = require 'nib'
+stylus        = require 'gulp-stylus'
+concat        = require 'gulp-concat'
+throttle      = require 'throttleit'
+child_process = require 'child_process'
 
 JS_OUTFILE                  = 'bundle.js'
 THIRDPARTY_OUTDIR           = 'thirdparty'

      outdir    : defined opts.outdir, process.cwd()
      baseurl   : defined opts.baseurl, '/'
      defaults  : defined opts.globalsFile, {}
      cfg       : defined opts.configFile, {}
      manifests : defined opts.use, []

    opts.basedir = path.resolve __dirname, opts.basedir
    opts.outdir = path.resolve __dirname, opts.outdir

    if 'string' is typeof opts.cfg
      opts.cfg = require @_resolve(opts.cfg)

    opts.config = defined opts.cfg.config, {}
    opts.schema = defined opts.cfg.schema, {}
    opts.rev    = defined opts.config.version, '2.0'

    if opts.revId
      opts.outdir = path.join opts.outdir, opts.rev
      opts.baseurl = "#{opts.baseurl}/#{opts.rev}"

    opts.spriteTmpCssOutdir = @_resolve SPRITES_TMPDIR

              createDirs dirs, =>
                opts.manifests = manifests
                opts.rsManifests = rsManifests
                getModels()
            cb()

          s.pipe(parse).pipe(tr)
