From 85a7c1c35b14b666caa00f79caaafcbe8c657b04 Mon Sep 17 00:00:00 2001 From: Mogens Heller Grabe Date: Mon, 22 Aug 2016 10:39:56 +0200 Subject: [PATCH 1/2] improve error message on streaming error --- wiredep.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiredep.js b/wiredep.js index c5f1e3e..7d81350 100644 --- a/wiredep.js +++ b/wiredep.js @@ -135,7 +135,7 @@ wiredep.stream = function (opts) { file.contents = new Buffer(wiredep(opts)); } catch (err) { - this.emit('error', err); + this.emit('error', 'Error processing file ' + file.path + ': ' + err); } this.push(file); From 221bd77c4cacd85631fd8832cfd7f337d91e151f Mon Sep 17 00:00:00 2001 From: Mogens Heller Grabe Date: Mon, 22 Aug 2016 10:42:07 +0200 Subject: [PATCH 2/2] fix TypeError when streaming an empty file --- wiredep.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiredep.js b/wiredep.js index 7d81350..8b6a8dc 100644 --- a/wiredep.js +++ b/wiredep.js @@ -128,7 +128,7 @@ wiredep.stream = function (opts) { try { opts.stream = { - src: file.contents.toString(), + src: file.contents.toString() || " ", //< must be anything but an empty string or null path: file.path, fileType: $.path.extname(file.path).substr(1) };