         repoDir = sysPath.join(userDir, repo)
         if isDirectory(repoDir)
           aliases[repo] = aliases["#{user}/#{repo}"] = "components/#{user}/#{repo}/index"
+
+          # extract package deps from component.json
+          json = fs.readFileSync(sysPath.join(repoDir, 'component.json'))
+          json = JSON.parse(json)
+          if json.dependencies
+            packageDeps["#{user}/#{repo}"] = Object.keys(json.dependencies)
 
 buildAliases()
 

  # Find all the require calls and push them into dependencies.
  content
    .replace(commentRegex, '') # remove comments
    .replace(cjsRequireRegex, (match, dep) -> deps.push(dep))
  deps

module.exports = {setEnv, compileDir, watchDir, startAndWatchServer}


          modulePath = sysPath.relative(publicDir, path)[...-3]
          deps = parseDeps(js)

          # Concat package deps
          match = modulePath.match(/^components\/(.*)\/(.*)\//)
          if match
            extraDeps = packageDeps["#{match[1]}/#{match[2]}"]
            if extraDeps?.length > 0
              deps = deps.concat(extraDeps)

          js = "define('#{modulePath}', #{JSON.stringify(deps)}, function(require, exports, module) {#{js}});"
          fs.writeFileSync path, js
          logging.info "copied #{source}"
