Search for module under the app directory
authorRyohei Ikegami <iofg2100@gmail.com>
Mon, 3 Apr 2017 11:12:02 +0000 (20:12 +0900)
committerRyohei Ikegami <iofg2100@gmail.com>
Mon, 3 Apr 2017 11:19:10 +0000 (20:19 +0900)
lib/renderer/init.js

index 38441c9..c6fd6a2 100644 (file)
@@ -116,6 +116,9 @@ if (nodeIntegration === 'true') {
   } else {
     global.__filename = __filename
     global.__dirname = __dirname
+
+    // Search for module under the app directory
+    module.paths = module.paths.concat(Module._nodeModulePaths(electron.remote.app.getAppPath()))
   }
 
   // Redirect window.onerror to uncaughtException.