 singleQuote = (str) ->
   "'" + str.replace("'", "\\'") + "'"
 
-commonJsRequire = (dep) ->
+commonJSRequire = (dep) ->
   "require(" + singleQuote(dep) + ")"
 
 browserRequire = (dep) ->

    s "    #{__module__} = factory(root)"
    s "    define -> #{__module__}"

  s "  else if typeof module is 'object' && typeof module.exports is 'object'"

  s (if options.global
    "    module.exports = "
  else "    ") + "factory(#{['root'].concat(deps.map(commonJsRequire)).join(', ')})"
  s "  else"

  s (if options.global

  globals = _.filter(_.pluck(options.dependencies, 'global'))

  s "((root, factory) ->"
  s ""
  s "  # AMD"
  s "  if typeof define is 'function' and define.amd"

  if deps.length
