From ff3b9d9251d10c34123021d6e67a4699ebcac5f4 Mon Sep 17 00:00:00 2001 From: Akshit Kr Nagpal Date: Thu, 24 May 2018 19:32:27 +0530 Subject: Added production config and fixed pack script (#32) --- main.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'main.js') 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 }); -- cgit v1.2.3