Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Realign sourcemap content lines after minification step
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Sep 17, 2013
1 parent b9ac3b9 commit f9c7d04
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ module.exports = function(grunt) {
grunt.registerTask('sourcemap_copy', 'Copy sourcesContent between sourcemaps', function(source, dest) {
var sourceMap = grunt.file.readJSON(source);
var destMap = grunt.file.readJSON(dest);
destMap.sourcesContent = sourceMap.sourcesContent;
destMap.sourcesContent = [];
var ssources = sourceMap.sources;
// uglify may reorder sources, make sure sourcesContent matches new order
destMap.sources.forEach(function(source) {
var j = ssources.indexOf(source);
destMap.sourcesContent.push(sourceMap.sourcesContent[j]);
});
grunt.file.write(dest, JSON.stringify(destMap));
});

Expand Down

0 comments on commit f9c7d04

Please sign in to comment.