 
   '.styl': (contents, filename) ->
     require('stylus')(contents)
-      .set('filename', process.cwd() + '/' + filename)
+      .set('filename', @appDir + '/' + filename)
       .use(require('nib')())
       .render (err, out) ->
         throw(err) if err

# Goes through asset declarations and expands them into full file paths, globs and all.
expandAssetGlobs = =>
  assets = {js: {}, css: {}, jst: {}}
  appDir = process.cwd().replace(/\\/g, "\/")
  for key, obj of @originalAssets
    for pkg, patterns of @originalAssets[key]
      matches = []

  expandAssetGlobs()

  # Config defaults
  @appDir = (if options.appDir? then options.appDir else process.cwd())
  @publicDir = path.resolve(@appDir, options.publicDir || 'public')
  @mode = options.mode ? switch process.env.NODE_ENV
    when 'staging' then 'production'
    when 'production' then 'production'
