From ae4baad4f3cb995830fcac25e03670eff2373883 Mon Sep 17 00:00:00 2001 From: Jeff Blaisdell Date: Sun, 21 Feb 2016 09:18:27 -0600 Subject: [PATCH] ISSUE-184: Allow browserify configuration to be passed through to bundler. --- .gitignore | 1 + lib/bundle.js | 14 +++++++++++--- lib/exe.js | 3 ++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c3b31c6..76a561f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ test/**/tmp test/**/node_modules test/**/*.map src +.idea diff --git a/lib/bundle.js b/lib/bundle.js index a520b8f..6e47642 100644 --- a/lib/bundle.js +++ b/lib/bundle.js @@ -69,15 +69,23 @@ function bundle(input, nc, options, complete) { insertGlobalVars: insertGlobalVars, detectGlobals: true, browserField: false - }).add(input) + }).add(input); + + if (options.browserifyExcludes && Array.isArray(options.browserifyExcludes)) { + for (let i = 0; i < options.browserifyExcludes.length; i++) { + let lib = options.browserifyExcludes[i]; + _log('Excluding lib from browserify bundle', lib); + bproc.exclude(lib); + } + } if(options.debug) { bproc.require(require.resolve('source-map-support')) } let bprocbun = bproc.bundle() // bundle - .pipe(exorcist(mapfile, mapfile, './')) // generate source maps. - .pipe(ws) // pipe to file + .pipe(exorcist(mapfile, mapfile, './')) // generate source maps. + .pipe(ws) // pipe to file ws.on('error', function(err) { console.log(err); diff --git a/lib/exe.js b/lib/exe.js index 49640d5..94fdac3 100644 --- a/lib/exe.js +++ b/lib/exe.js @@ -60,7 +60,8 @@ var option_list = [ "framework", "nodeConfigureArgs", "nodeMakeArgs", - "nodeVersion" + "nodeVersion", + "browserifyExcludes" ] /**