   
   # Configuration helper function
   udefine.configure = (configFunc) ->
-    configFunc.apply udefine, [root]
+    configFunc.apply udefine, [if hasModule then module.exports else root]
   
   # Export udefine function on CommonJS environments
   if hasModule then module.exports = udefine else root.udefine = udefine
  udefine = (name, deps, factory) ->
    throw new Error 'A udefine module needs to have a name' unless name?
    
    if typeof deps is 'function' or isObject(deps)
      [name, deps, factory] = [name, [], deps]
      

do -> Array.isArray ?= (a) -> a.push is Array.prototype.push and a.length?

# Module switch
hasModule = !!(module? and module.exports)
exportObject = {}

# Safe way to test against an object without array being a false positive
