Update requires paths
This commit is contained in:
parent
f109591d03
commit
006c77a00f
6 changed files with 11 additions and 12 deletions
|
@ -165,7 +165,6 @@ node::Environment* NodeBindings::CreateEnvironment(
|
||||||
base::FilePath script_path =
|
base::FilePath script_path =
|
||||||
resources_path.Append(FILE_PATH_LITERAL("atom.asar"))
|
resources_path.Append(FILE_PATH_LITERAL("atom.asar"))
|
||||||
.Append(process_type)
|
.Append(process_type)
|
||||||
.Append(FILE_PATH_LITERAL("lib"))
|
|
||||||
.Append(FILE_PATH_LITERAL("init.js"));
|
.Append(FILE_PATH_LITERAL("init.js"));
|
||||||
std::string script_path_str = script_path.AsUTF8Unsafe();
|
std::string script_path_str = script_path.AsUTF8Unsafe();
|
||||||
args.insert(args.begin() + 1, script_path_str.c_str());
|
args.insert(args.begin() + 1, script_path_str.c_str());
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const common = require('../../../../common/api/lib/exports/electron');
|
const common = require('../../../common/api/exports/electron');
|
||||||
|
|
||||||
|
|
||||||
// Import common modules.
|
// Import common modules.
|
||||||
|
|
|
@ -11,19 +11,19 @@ var slice = [].slice;
|
||||||
process.argv.splice(1, 1);
|
process.argv.splice(1, 1);
|
||||||
|
|
||||||
// Clear search paths.
|
// Clear search paths.
|
||||||
require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'reset-search-paths'));
|
require(path.resolve(__dirname, '..', 'common', 'reset-search-paths'));
|
||||||
|
|
||||||
// Import common settings.
|
// Import common settings.
|
||||||
require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'init'));
|
require(path.resolve(__dirname, '..', 'common', 'init'));
|
||||||
|
|
||||||
var globalPaths = Module.globalPaths;
|
var globalPaths = Module.globalPaths;
|
||||||
|
|
||||||
if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
|
if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
|
||||||
globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib'));
|
globalPaths.push(path.resolve(__dirname, 'api'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expose public APIs.
|
// Expose public APIs.
|
||||||
globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib', 'exports'));
|
globalPaths.push(path.resolve(__dirname, 'api', 'exports'));
|
||||||
|
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === '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
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const common = require('../../../../common/api/lib/exports/electron');
|
const common = require('../../../common/api/exports/electron');
|
||||||
|
|
||||||
// Import common modules.
|
// Import common modules.
|
||||||
common.defineProperties(exports);
|
common.defineProperties(exports);
|
||||||
|
|
|
@ -244,7 +244,7 @@ ipcRenderer.on('ATOM_RENDERER_RELEASE_CALLBACK', function(event, id) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// List all built-in modules in browser process.
|
// List all built-in modules in browser process.
|
||||||
const browserModules = require('../../../browser/api/lib/exports/electron');
|
const browserModules = require('../../browser/api/exports/electron');
|
||||||
|
|
||||||
// And add a helper receiver for each one.
|
// And add a helper receiver for each one.
|
||||||
var fn = function(name) {
|
var fn = function(name) {
|
||||||
|
|
|
@ -9,19 +9,19 @@ const Module = require('module');
|
||||||
process.argv.splice(1, 1);
|
process.argv.splice(1, 1);
|
||||||
|
|
||||||
// Clear search paths.
|
// Clear search paths.
|
||||||
require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'reset-search-paths'));
|
require(path.resolve(__dirname, '..', 'common', 'reset-search-paths'));
|
||||||
|
|
||||||
// Import common settings.
|
// Import common settings.
|
||||||
require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'init'));
|
require(path.resolve(__dirname, '..','common', 'init'));
|
||||||
|
|
||||||
var globalPaths = Module.globalPaths;
|
var globalPaths = Module.globalPaths;
|
||||||
|
|
||||||
if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
|
if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
|
||||||
globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib'));
|
globalPaths.push(path.resolve(__dirname, 'api'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expose public APIs.
|
// Expose public APIs.
|
||||||
globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib', 'exports'));
|
globalPaths.push(path.resolve(__dirname, 'api', 'exports'));
|
||||||
|
|
||||||
// The global variable will be used by ipc for event dispatching
|
// The global variable will be used by ipc for event dispatching
|
||||||
var v8Util = process.atomBinding('v8_util');
|
var v8Util = process.atomBinding('v8_util');
|
||||||
|
|
Loading…
Reference in a new issue