 preprocessPkg = (pkg, type) =>
   obj = {}
   for filename in @assets[type][pkg]
-    fullPath = path.resolve process.cwd() + '/' + filename
+    fullPath = path.resolve @appDir + '/' + filename
     contents = if fileHasChanged(fullPath) or not @_preprocessedCache[filename]?
                  data = fs.readFileSync(fullPath).toString()
                  @_preprocessedCache[filename] = preprocess(data, filename)

      for pkg, filenames of @assets.js
        for filename in filenames
          if req.url.replace(/^\/assets\/|.(?!.*\.).*/g, '') is filename.replace(/.(?!.*\.).*/, '')
            contents = fs.readFileSync(path.resolve process.cwd() + '/' + filename).toString()
            contents = preprocess contents, filename
            res.end contents
            return

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