From a058e13c10d47e3b5ca53113a1941bf32e626e2e Mon Sep 17 00:00:00 2001 From: Marcello Bastea-Forte Date: Tue, 17 Mar 2015 11:36:38 -0700 Subject: [PATCH] upgrade to browserify 9.0.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - update to new API - passes all tests except ‘routes’ --- index.js | 11 +++++++++-- package.json | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index d9b3f47..4550c68 100644 --- a/index.js +++ b/index.js @@ -38,7 +38,11 @@ module.exports = function enchilada(opt) { var emitter = new EventEmitter; + var browserifyCache = { cache: {}, packageCache: {}, fullPaths: true }; + function makeBundle(options) { + options.debug = debug_opt; + options.basedir = pubdir; var bundle = browserify(options); if (opt.transforms) { opt.transforms.forEach(function(transform) { @@ -105,7 +109,7 @@ module.exports = function enchilada(opt) { return notFound(); } - var bundle = makeBundle(local_file); + var bundle = makeBundle({entries:[local_file]}); Object.keys(bundles).forEach(function(id) { bundle.external(bundles[id]); }); @@ -144,7 +148,7 @@ module.exports = function enchilada(opt) { bundle.on('file', collect_deps); } - bundle.bundle({ debug: debug_opt }, function(err, src) { + bundle.bundle(function(err, src) { bundle.removeListener('file', collect_deps); if (watch) { @@ -157,6 +161,9 @@ module.exports = function enchilada(opt) { return callback(otherError); } + // src is a Buffer + src = src.toString('utf8'); + var srcmap = undefined; var map_path = undefined; if (debug_opt) { diff --git a/package.json b/package.json index e4cf931..bd37c3e 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "license": "MIT", "dependencies": { "mime": "1.2.11", - "browserify": "4.1.9", + "browserify": "9.0.3", "filewatcher": "1.1.1", "uglify-js": "2.4.13", "debug": "1.0.1",