From 3b25e7409b9a3dcab2bdf109ee64dc5a76f79eaf Mon Sep 17 00:00:00 2001 From: Jared Allard Date: Tue, 23 Feb 2016 23:34:08 -0800 Subject: [PATCH] bundle: add process to global vars, may fix some issues --- lib/bundle.js | 7 ++----- lib/exe.js | 7 +++++-- package.json | 13 ++----------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/lib/bundle.js b/lib/bundle.js index a5d4725..e505d12 100644 --- a/lib/bundle.js +++ b/lib/bundle.js @@ -25,14 +25,12 @@ 'use strict'; -let exorcist = require('exorcist'), - browserify = require('browserify'), +let browserify = require('browserify'), path = require("path"), spawn = require('child_process').spawn, insertGlobals = require('insert-module-globals'), fs = require("fs"), async = require("async"), - builtins = require("builtins"), _log = require("./log"); /** @@ -49,7 +47,7 @@ function bundle(input, nc, options, complete) { let ws = fs.createWriteStream(bundlePath); - const igv = '__filename,__dirname'; + const igv = '__filename,__dirname,process'; let insertGlobalVars = {}, wantedGlobalVars = igv.split(','); @@ -102,7 +100,6 @@ function bundle(input, nc, options, complete) { } let bprocbun = bproc.bundle() // bundle - .pipe(exorcist(mapfile, mapfile, './')) // generate source maps. .pipe(ws) // pipe to file // error on require errors, still can't contionue. ffs browserify diff --git a/lib/exe.js b/lib/exe.js index 4f3c25f..378db9a 100644 --- a/lib/exe.js +++ b/lib/exe.js @@ -26,7 +26,6 @@ 'use strict'; const async = require("async"), - outcome = require("outcome"), mkdirp = require("mkdirp"), request = require("request"), gunzip = require("gunzip-maybe"), @@ -987,14 +986,18 @@ exports.package = function(path, options) { obj.browserifyPaths = (_package.nexe.browserify.paths || []); } + // TODO: get rid of this crappy code I wrote and make it less painful to read. Object.keys(_package.nexe).forEach(function(v, i) { - if (v !== "runtime") { + if (v !== "runtime" && v !== 'browserify') { _log("log", v + " => '" + _package.nexe[v] + "'"); } }); Object.keys(_package.nexe.runtime).forEach(function(v, i) { _log("log", "runtime." + v + " => '" + _package.nexe.runtime[v] + "'"); }); + Object.keys(_package.nexe.browserify).forEach(function(v, i) { + _log("log", "browserify." + v + " => '" + _package.nexe.browserify[v] + "'"); + }); return obj; } diff --git a/package.json b/package.json index 5c37a29..67bf6b9 100644 --- a/package.json +++ b/package.json @@ -17,23 +17,17 @@ }, "main": "./lib/index.js", "dependencies": { - "async": "1.5.2", + "async": "^1.5.2", "browserify": "^13.0.0", - "builtins": "1.0.3", "colors": "^1.1.2", - "exorcist": "^0.4.0", - "glob": "^6.0.4", + "glob": "^7.0.0", "gunzip-maybe": "^1.3.1", "insert-module-globals": "^7.0.1", "mkdirp": "^0.5.1", "module-deps": "^4.0.5", "ncp": "^2.0.0", - "outcome": "0.0.18", "progress": "^1.1.8", "request": "^2.67.0", - "source-map-support": "^0.4.0", - "sprintf": "~0.1.5", - "step": "0.0.x", "tar-stream": "^1.3.1", "yargs": "^3.32.0" }, @@ -41,9 +35,6 @@ "input": "./bin/nexe", "output": "nexe^$", "temp": "src", - "browserifyRequires": [ - "lib/nexeres.js" - ], "runtime": { "framework": "nodejs", "version": "5.5.0",