From 970817e0f4e0d18375945bb4feeef8267cba03e3 Mon Sep 17 00:00:00 2001 From: jpheur Date: Mon, 30 May 2016 12:05:43 +0300 Subject: [PATCH] Fixes "Native module not found" problem --- lib/exe.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/exe.js b/lib/exe.js index b7b0767..217ad7d 100644 --- a/lib/exe.js +++ b/lib/exe.js @@ -673,13 +673,17 @@ function _monkeyPatchMainJs(compiler, complete) { return ~content.indexOf("nexe"); }, function(content, next) { - next(null, content.replace(/\(function\(process\) \{/, '\ + content = content.replace(/\(function\(process\) \{/, '\ (function(process) {\n\ - process._eval = \'require("nexe");\';\n\ if (process.argv[1] !== "nexe.js") {\n\ process.argv.splice(1, 0, "nexe.js");\n\ }\n\ -')) +') + content = content.replace('function startup() {', '\ +function startup() {\n\ + process._eval = NativeModule.getSource("nexe");\n\ +') + next(null, content) }, complete );