-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (22 loc) · 746 Bytes
/
index.js
File metadata and controls
27 lines (22 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict';
const platform = require('electron-platform');
const pkgJson = require('./package.json');
let windowPlus;
let name = `__electron_window_plus__`;
let msg = `Failed to require ${pkgJson.name}@${pkgJson.version}:
A different version of ${pkgJson.name} already running in the process, we will redirect to it.
Please make sure your dependencies use the same version of ${pkgJson.name}.`;
if ( platform.isMainProcess ) {
if (global[name]) {
console.warn(msg);
windowPlus = global[name];
} else {
windowPlus = global[name] = require('./lib/main');
}
} else {
// windowPlus = require('./lib/renderer/index');
}
// ==========================
// exports
// ==========================
module.exports = windowPlus;