This repository was archived by the owner on Sep 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-13
lines changed Expand file tree Collapse file tree 3 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,11 @@ module.exports = function(initOptions) {
196
196
197
197
for ( var i = 0 ; i < outputFiles . length ; i ++ ) {
198
198
if ( outputFiles [ i ] . sourceMap ) {
199
+ if ( outputFiles [ i ] . sourceMap . sources ) {
200
+ outputFiles [ i ] . sourceMap . sources = outputFiles [ i ] . sourceMap . sources . map ( function ( sourcePath ) {
201
+ return path . isAbsolute ( sourcePath [ 0 ] ) ? sourcePath . substr ( 1 ) : sourcePath ;
202
+ } ) ;
203
+ }
199
204
applySourceMap ( outputFiles [ i ] , outputFiles [ i ] . sourceMap ) ;
200
205
}
201
206
this . push ( outputFiles [ i ] ) ;
Original file line number Diff line number Diff line change @@ -41,17 +41,7 @@ module.exports = function(input) {
41
41
contents : new Buffer ( fileList [ i ] . src )
42
42
} ) ;
43
43
if ( fileList [ i ] . source_map ) {
44
-
45
- // Undo what concat-to-json.js did to the source map paths
46
- var sourceMap = JSON . parse ( fileList [ i ] . source_map ) ;
47
- var sources = sourceMap . sources ;
48
- for ( var j = 0 ; j < sources . length ; j ++ ) {
49
- var source = sources [ j ] ;
50
- if ( path . isAbsolute ( source ) ) {
51
- sources [ j ] = path . relative ( '/' , source ) ;
52
- }
53
- }
54
- file . sourceMap = sourceMap ;
44
+ file . sourceMap = JSON . parse ( fileList [ i ] . source_map ) ;
55
45
}
56
46
outputFiles . push ( file ) ;
57
47
}
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ var sourcemaps = require('gulp-sourcemaps');
29
29
var File = require ( 'vinyl' ) ;
30
30
var compilerPackage = require ( '../' ) ;
31
31
var closureCompiler = compilerPackage . gulp ( ) ;
32
- var fs = require ( 'fs' ) ;
33
32
require ( 'mocha' ) ;
34
33
35
34
describe ( 'gulp-google-closure-compiler' , function ( ) {
@@ -166,7 +165,6 @@ describe('gulp-google-closure-compiler', function() {
166
165
. pipe ( assert . length ( 1 ) )
167
166
. pipe ( assert . first ( function ( f ) {
168
167
f . sourceMap . sources . should . have . length ( 2 ) ;
169
- f . sourceMap . sources . should . matchEach ( fs . existsSync ) ;
170
168
f . sourceMap . file . should . eql ( 'compiled.js' ) ;
171
169
} ) )
172
170
. pipe ( assert . end ( done ) ) ;
You can’t perform that action at this time.
0 commit comments