[Pkg-javascript-commits] [node-browser-pack] 64/141: Fixes source maps for --require'd modules

Bastien Roucariès rouca at moszumanska.debian.org
Thu May 4 10:23:25 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 45b153aa1c3035ff346f04776176ce1b82fe3ab4
Author: Edward Faulkner <ef at alum.mit.edu>
Date:   Tue Aug 6 01:54:43 2013 -0400

    Fixes source maps for --require'd modules
---
 index.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index 9f41392..400a6e3 100644
--- a/index.js
+++ b/index.js
@@ -29,13 +29,15 @@ module.exports = function (opts) {
     
     var lineno = 1 + newlinesIn(prelude);
     var sourcemap;
+    var seenSourceFiles = {};
     
     return stream;
     
     function write (row) {
         if (first) stream.queue((opts.prelude || prelude) + '({');
         
-        if (row.sourceFile) { 
+        if (row.sourceFile && !seenSourceFiles[row.sourceFile]) { 
+	    seenSourceFiles[row.sourceFile] = true;
             sourcemap = sourcemap || combineSourceMap.create();
             sourcemap.addFile(
                 { sourceFile: row.sourceFile, source: row.source },

-- 
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