Add ELECTRON_DISABLE_OLD_STYLE_MODULES env
This commit is contained in:
parent
c2c09daa23
commit
f9d7e7ce55
3 changed files with 11 additions and 8 deletions
|
@ -13,12 +13,13 @@ require path.resolve(__dirname, '..', '..', 'common', 'lib', 'reset-search-paths
|
||||||
# Import common settings.
|
# Import common settings.
|
||||||
require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init')
|
require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init')
|
||||||
|
|
||||||
# Add browser/api/lib to module search paths, which contains javascript part of
|
# Expose public APIs.
|
||||||
# Electron's built-in libraries.
|
|
||||||
globalPaths = Module.globalPaths
|
globalPaths = Module.globalPaths
|
||||||
globalPaths.push path.resolve(__dirname, '..', 'api', 'lib')
|
|
||||||
globalPaths.push path.resolve(__dirname, '..', 'api', 'lib', 'exports')
|
globalPaths.push path.resolve(__dirname, '..', 'api', 'lib', 'exports')
|
||||||
|
|
||||||
|
unless process.env.ELECTRON_DISABLE_OLD_STYLE_MODULES
|
||||||
|
globalPaths.push path.resolve(__dirname, '..', 'api', 'lib')
|
||||||
|
|
||||||
if process.platform is 'win32'
|
if process.platform is 'win32'
|
||||||
# Redirect node's console to use our own implementations, since node can not
|
# Redirect node's console to use our own implementations, since node can not
|
||||||
# handle console output when running as GUI program.
|
# handle console output when running as GUI program.
|
||||||
|
|
|
@ -9,8 +9,9 @@ process.atomBinding = (name) ->
|
||||||
catch e
|
catch e
|
||||||
process.binding "atom_common_#{name}" if /No such module/.test e.message
|
process.binding "atom_common_#{name}" if /No such module/.test e.message
|
||||||
|
|
||||||
# Add common/api/lib to module search paths.
|
unless process.env.ELECTRON_DISABLE_OLD_STYLE_MODULES
|
||||||
Module.globalPaths.push path.resolve(__dirname, '..', 'api', 'lib')
|
# Add common/api/lib to module search paths.
|
||||||
|
Module.globalPaths.push path.resolve(__dirname, '..', 'api', 'lib')
|
||||||
|
|
||||||
# setImmediate and process.nextTick makes use of uv_check and uv_prepare to
|
# setImmediate and process.nextTick makes use of uv_check and uv_prepare to
|
||||||
# run the callbacks, however since we only run uv loop on requests, the
|
# run the callbacks, however since we only run uv loop on requests, the
|
||||||
|
|
|
@ -13,12 +13,13 @@ require path.resolve(__dirname, '..', '..', 'common', 'lib', 'reset-search-paths
|
||||||
# Import common settings.
|
# Import common settings.
|
||||||
require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init')
|
require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init')
|
||||||
|
|
||||||
# Add renderer/api/lib to require's search paths, which contains javascript part
|
# Expose public APIs.
|
||||||
# of Atom's built-in libraries.
|
|
||||||
globalPaths = Module.globalPaths
|
globalPaths = Module.globalPaths
|
||||||
globalPaths.push path.resolve(__dirname, '..', 'api', 'lib')
|
|
||||||
globalPaths.push path.resolve(__dirname, '..', 'api', 'lib', 'exports')
|
globalPaths.push path.resolve(__dirname, '..', 'api', 'lib', 'exports')
|
||||||
|
|
||||||
|
unless process.env.ELECTRON_DISABLE_OLD_STYLE_MODULES
|
||||||
|
globalPaths.push path.resolve(__dirname, '..', 'api', 'lib')
|
||||||
|
|
||||||
# The global variable will be used by ipc for event dispatching
|
# The global variable will be used by ipc for event dispatching
|
||||||
v8Util = process.atomBinding 'v8_util'
|
v8Util = process.atomBinding 'v8_util'
|
||||||
v8Util.setHiddenValue global, 'ipc', new events.EventEmitter
|
v8Util.setHiddenValue global, 'ipc', new events.EventEmitter
|
||||||
|
|
Loading…
Reference in a new issue