This repository was archived by the owner on Nov 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,8 @@ exports.init = function(grunt) {
136136 // Add the lines of a given file to the sourcemap. If in the file, store a
137137 // prior sourcemap and return src with sourceMappingURL removed.
138138 SourceMapConcatHelper . prototype . addlines = function ( src , filename ) {
139- var relativeFilename = path . relative ( path . dirname ( this . dest ) , filename ) ;
139+ var destDirectory = path . dirname ( this . dest ) ,
140+ relativeFilename = path . relative ( destDirectory , filename ) ;
140141 // sourceMap path references are URLs, so ensure forward slashes are used for paths passed to sourcemap library
141142 relativeFilename = relativeFilename . replace ( / \\ / g, '/' ) ;
142143 if (
@@ -162,7 +163,7 @@ exports.init = function(grunt) {
162163 var sourceMap = JSON . parse ( sourceContent ) ;
163164 var sourceMapConsumer = new SourceMapConsumer ( sourceMap ) ;
164165 // Consider the relative path from source files to new sourcemap.
165- var sourcePathToSourceMapPath = path . relative ( path . dirname ( this . dest ) , sourceMapDir ) ;
166+ var sourcePathToSourceMapPath = path . relative ( destDirectory , sourceMapConsumer . sourceRoot || path . dirname ( sourceMapPath ) ) ;
166167 // Transfer the existing mappings into this mapping
167168 var initLine = this . line ;
168169 var initCol = this . column ;
You can’t perform that action at this time.
0 commit comments