From 6bc14d9fa80c2ee2b0a6c2fed756a8b54f0f526c Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 17 Oct 2018 23:31:07 +0200 Subject: [PATCH] scripts: watchify: add error logging --- scripts/build-browser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build-browser.js b/scripts/build-browser.js index f0db3914..05a7fca9 100644 --- a/scripts/build-browser.js +++ b/scripts/build-browser.js @@ -55,7 +55,7 @@ if (prod) b = b.transform(ignoreWrapper(uglifyify), {global: true}) if (watch) { b.on('update', bundle) - b.on('log', function(msg) {console.warn(msg)}) + b.on('log', function(msg) {console.warn('\x1b[36m%s\x1b[0m', msg)}) } bundle() @@ -63,6 +63,7 @@ bundle() function bundle() { var output = b.bundle() + output.on('error', function(err) {console.error(new Error(err))}) if (!fast) output.pipe(exorcist(outputPath + '.map'))