From 34f92b605d87527f81559b72f42110386e9eb442 Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Thu, 13 Mar 2014 12:41:11 -0400 Subject: [PATCH] soop may not be in the bitcore directory If bitcore is being built inside of another project that uses soop, soop may not be in the bitcore directory. We need to find the location of soop and then find the custom_prelude script relative to that. --- browser/build.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/browser/build.js b/browser/build.js index 4deae0085..ca91ca638 100644 --- a/browser/build.js +++ b/browser/build.js @@ -40,7 +40,9 @@ if (!program.includeall && (!program.submodules || program.submodules.length === } var pack = function (params) { - var preludePath = 'node_modules/soop/example/custom_prelude.js'; + var file = require.resolve('soop'); + var dir = file.substr(0, file.length - String('soop.js').length); + var preludePath = dir + 'example/custom_prelude.js'; params.raw = true; params.sourceMapPrefix = '//#'; params.prelude = fs.readFileSync(preludePath, 'utf8');