[Pkg-javascript-commits] [node-browser-pack] 76/141: passing test for sourceMapPrefix

Bastien Roucariès rouca at moszumanska.debian.org
Thu May 4 10:23:26 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-browser-pack.

commit 31fed3c009ea75c3aaebd5a6e8fb7bcc38f86a34
Author: James Halliday <mail at substack.net>
Date:   Mon Nov 18 16:00:46 2013 +0800

    passing test for sourceMapPrefix
---
 index.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index 69c0ff1..5074318 100644
--- a/index.js
+++ b/index.js
@@ -75,7 +75,15 @@ module.exports = function (opts) {
         entries = entries.filter(function (x) { return x !== undefined });
         
         stream.queue('},{},' + JSON.stringify(entries) + ')');
-        if (sourcemap) stream.queue('\n' + sourcemap.comment());
+        if (sourcemap) {
+            var comment = sourcemap.comment();
+            if (opts.sourceMapPrefix) {
+                comment = comment.replace(
+                    /^\/\/#/, function () { return opts.sourceMapPrefix }
+                )
+            }
+            stream.queue('\n' + comment);
+        }
 
         stream.queue(null);
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-browser-pack.git



More information about the Pkg-javascript-commits mailing list