From de51d8fc191366d36d4b8e5a12056cd3d217956b Mon Sep 17 00:00:00 2001 From: Shawn Date: Fri, 15 Mar 2019 22:44:02 -0500 Subject: [PATCH] Fix daemon not spawning in dev mode --- package.json | 3 +-- src/platforms/electron/Daemon.js | 4 +++- webpack.electron.config.js | 5 ++++- yarn.lock | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 763ab4cdc..40b2f83dd 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "electron-log": "^2.2.12", "electron-updater": "^4.0.6", "express": "^4.16.4", - "keytar": "4.4.1" + "keytar": "^4.4.1" }, "devDependencies": { "@babel/core": "^7.0.0", @@ -100,7 +100,6 @@ "hast-util-sanitize": "^1.1.2", "husky": "^0.14.3", "json-loader": "^0.5.4", - "keytar": "4.4.1", "lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-redux": "lbryio/lbry-redux#2a7e05940f892f104428eeb37bd1f178da811a09", "lbryinc": "lbryio/lbryinc#351d0a08806b0f770b50066b61a806171f6424d4", diff --git a/src/platforms/electron/Daemon.js b/src/platforms/electron/Daemon.js index 979bc5a1f..223015ff7 100644 --- a/src/platforms/electron/Daemon.js +++ b/src/platforms/electron/Daemon.js @@ -4,7 +4,9 @@ import { spawn, execSync } from 'child_process'; import { Lbry } from 'lbry-redux'; export default class Daemon { - static path = process.env.LBRY_DAEMON || path.join(process.resourcesPath, 'static', 'lbrynet'); + static path = process.env.LBRY_DAEMON || ( + process.env.NODE_ENV === 'production' ? path.join(process.resourcesPath, 'static', 'lbrynet') : path.join(__static, 'lbrynet') + ); subprocess; handlers; diff --git a/webpack.electron.config.js b/webpack.electron.config.js index 9a346022f..4f32cc0da 100644 --- a/webpack.electron.config.js +++ b/webpack.electron.config.js @@ -60,7 +60,10 @@ if (process.env.NODE_ENV === 'production') { const nodeExternals = require('webpack-node-externals'); // Apply dev overrides mainConfig = merge(mainConfig, { - externals: [nodeExternals()], + externals: { + keytar: 'require("keytar")', + electron: 'require("electron")', + }, }); } diff --git a/yarn.lock b/yarn.lock index b8892cfad..ad9f9f43f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5982,7 +5982,7 @@ kebab-case@^1.0.0: resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.0.tgz#3f9e4990adcad0c686c0e701f7645868f75f91eb" integrity sha1-P55JkK3K0MaGwOcB92RYaPdfkes= -keytar@4.4.1: +keytar@^4.4.1: version "4.4.1" resolved "https://registry.yarnpkg.com/keytar/-/keytar-4.4.1.tgz#156af8a9b016bf118ee9948b02418c81d760a5ba" integrity sha512-6xEe7ybXSR5EZC+z0GI2yqLYZjV1tyPQY2xSZ8rGsBxrrLEh8VR/Lfqv59uGX+I+W+OZxH0jCXN1dU1++ify4g==