     s "    #{__module__} = factory(root)"
     s "    define -> #{__module__}"
 
+  s ""
+  s "  # CommonJS"
   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(', ')})"
+  else "    ") + "factory(#{['root'].concat(deps.map(commonJSRequire)).join(', ')})"
+
+  s ""
+  s "  # Browser and the rest"
   s "  else"
 
   s (if options.global

singleQuote = (str) ->
  "'" + str.replace("'", "\\'") + "'"

commonJsRequire = (dep) ->
  "require(" + singleQuote(dep) + ")"

browserRequire = (dep) ->

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

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

  if deps.length
