From 58dc0ee3bb6ad1cd5b161cb85facfa34a5696519 Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Thu, 20 Feb 2014 19:32:16 -0800 Subject: [PATCH] Print a warning if the generated source map failed to be applied --- tools/bundler.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/bundler.js b/tools/bundler.js index a9beb901dd..c9ae8dca03 100644 --- a/tools/bundler.js +++ b/tools/bundler.js @@ -840,8 +840,13 @@ _.extend(ClientTarget.prototype, { _.each(originals, function (file, name) { if (! file.sourceMap) return; - newMap.applySourceMap( - new sourcemap.SourceMapConsumer(file.sourceMap), name); + try { + newMap.applySourceMap( + new sourcemap.SourceMapConsumer(file.sourceMap), name); + } catch (err) { + console.log("warn: failed to apply the source map for " + + name.slice(0, name.length - 4)); + } }); self.css[0].setSourceMap(JSON.stringify(newMap));