   "#{resourcePath}/vendor"
 ]
 
+window.__filename = null
+
 require = (file, cb) ->
   return cb require file if cb?
 


  return __modules[file] if __modules[file]?

  __modules[file] = {} # Fix for circular references
  __modules[file] = (exts[ext] or (file) -> __read file) file
  __modules[file]

defines = []

# Ace define uses just one var, our stuff wants two. 
#
# file - The String that contains the filename of the code we are requiring
#        (optional)
# cb   - The Function that will actually run the code.
define  = (args...) ->
  defines.push ->
    file = args[0] if args.length > 1
    cb = args[1] or args[0]
    exports = if file? then __modules[file] else {}
    module = exports: exports
    cb.call exports, require, exports, module
    module.exports or exports



    if not /define\(/.test code
      code = """
        define(function(require, exports, module) {
          #{code};
        });
      """
