diff --git a/ElectronClient/main.js b/ElectronClient/main.js index 1be84a8088..74dddf7ca9 100644 --- a/ElectronClient/main.js +++ b/ElectronClient/main.js @@ -1,11 +1,10 @@ -global.joplinLib = __dirname + '/../ReactNativeClient/lib'; +// Make it possible to require("/lib/...") without specifying full path +require('app-module-path').addPath(__dirname + '/../ReactNativeClient'); const {app, BrowserWindow} = require('electron') const path = require('path') const url = require('url') -//const { Logger } = require(joplinLib + '/logger.js'); - -//console.info(Logger); +const { Logger } = require('lib/logger.js'); // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. diff --git a/ElectronClient/package-lock.json b/ElectronClient/package-lock.json index 228b023daa..3590c6f6e3 100644 --- a/ElectronClient/package-lock.json +++ b/ElectronClient/package-lock.json @@ -95,6 +95,11 @@ "color-convert": "1.9.0" } }, + "app-module-path": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz", + "integrity": "sha1-ZBqlXft9am8KgUHEucCqULbCTdU=" + }, "app-package-builder": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/app-package-builder/-/app-package-builder-1.3.3.tgz", diff --git a/ElectronClient/package.json b/ElectronClient/package.json index e1e0c467eb..7db3464643 100644 --- a/ElectronClient/package.json +++ b/ElectronClient/package.json @@ -21,6 +21,7 @@ "electron-builder": "^19.43.4" }, "dependencies": { + "app-module-path": "^2.2.0", "sqlite3": "^3.1.13" } }