     app.setName packageJson.name
 
   # Finally load app's main.js and transfer control to C++.
-  require path.join(packagePath, packageJson.main)
+  module._load path.join(packagePath, packageJson.main), module, true

fs   = require 'fs'
path = require 'path'
util = require 'util'

# Expose information of current process.
process.type = 'browser'


# Add browser/api/lib to require's search paths,
# which contains javascript part of Atom's built-in libraries.
globalPaths = module.globalPaths
globalPaths.push path.join process.resourcesPath, 'atom', 'browser', 'api', 'lib'

# Do loading in next tick since we still need some initialize work before
