Skip to content

Commit

Permalink
Add support for global externals in Electron
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd authored and wooorm committed Apr 4, 2016
1 parent 385125b commit 2b31591
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var fs = require('fs');
var exists = fs && fs.existsSync;
var resolve = path && path.resolve;
var isWindows;
var isElectron;
var isGlobal;
var globals;
var cwd;
Expand All @@ -49,7 +50,8 @@ if (typeof global !== 'undefined') {

/* Detect whether we’re running as a globally installed package. */
isWindows = global.process.platform === 'win32';
isGlobal = global.process.argv[1].indexOf(npmPrefix) === 0;
isElectron = global.process.versions.electron !== undefined;
isGlobal = isElectron || global.process.argv[1].indexOf(npmPrefix) === 0;

/* istanbul ignore next */
globals = resolve(npmPrefix, isWindows ? '' : 'lib', MODULES);
Expand Down

0 comments on commit 2b31591

Please sign in to comment.