aboutsummaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorAkshit Kr Nagpal <akshitkrnagpal@gmail.com>2018-05-24 19:32:27 +0530
committerSaúl Ibarra Corretgé <s@saghul.net>2018-05-24 16:02:27 +0200
commitff3b9d9251d10c34123021d6e67a4699ebcac5f4 (patch)
treee696cff2d710789887512cb568a27900a0c7eb36 /main.js
parent42be5336146a0d7a3d2c448107e3025e2c553928 (diff)
Added production config and fixed pack script (#32)
Diffstat (limited to 'main.js')
-rw-r--r--main.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.js b/main.js
index a48be4e..3e70e8c 100644
--- a/main.js
+++ b/main.js
@@ -4,6 +4,8 @@ const electron = require('electron');
const APP = electron.app;
const BrowserWindow = electron.BrowserWindow;
+const isDev = require('electron-is-dev');
+
const {
setupAlwaysOnTopMain
} = require('jitsi-meet-electron-utils');
@@ -11,11 +13,17 @@ const {
const path = require('path');
const URL = require('url');
+
+/**
+ * Path to root directory
+ */
+const basePath = isDev ? __dirname : electron.app.getAppPath();
+
/**
* URL for index.html which will be our entry point.
*/
const indexURL = URL.format({
- pathname: path.resolve(__dirname, './build/index.html'),
+ pathname: path.resolve(basePath, './build/index.html'),
protocol: 'file:',
slashes: true
});