Skip to content

Commit 2b31591

Browse files
rhysdwooorm
authored andcommitted
Add support for global externals in Electron
1 parent 385125b commit 2b31591

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var fs = require('fs');
3636
var exists = fs && fs.existsSync;
3737
var resolve = path && path.resolve;
3838
var isWindows;
39+
var isElectron;
3940
var isGlobal;
4041
var globals;
4142
var cwd;
@@ -49,7 +50,8 @@ if (typeof global !== 'undefined') {
4950

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

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

0 commit comments

Comments
 (0)