Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

Commit b8dd0be

Browse files
Merge pull request #40 from ChadKillingsworth/native-sourcemaps
Remove manual source map composition as the compiler now does that natively
2 parents cdb920c + 703c207 commit b8dd0be

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

lib/gulp/index.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ module.exports = function(initOptions) {
4444
var PLUGIN_NAME = 'gulp-google-closure-compiler';
4545

4646
var extraCommandArguments = initOptions ? initOptions.extraArguments : undefined;
47-
var SourceMapGenerator = require('source-map').SourceMapGenerator;
48-
var SourceMapConsumer = require('source-map').SourceMapConsumer;
4947
var applySourceMap = require('vinyl-sourcemaps-apply');
5048
var path = require('path');
5149

@@ -175,21 +173,7 @@ module.exports = function(initOptions) {
175173

176174
for (var i = 0; i < outputFiles.length; i++) {
177175
if (outputFiles[i].sourceMap) {
178-
// Closure compiler does not compose source maps (use input source maps)
179-
// We need to manually compose the maps so that we reference the original file
180-
var generator = SourceMapGenerator.fromSourceMap(
181-
new SourceMapConsumer(outputFiles[i].sourceMap));
182-
outputFiles[i].sourceMap = undefined;
183-
184-
for (var j = 0; j < jsonFiles.length; j++) {
185-
if (!jsonFiles[j].sourceMap) {
186-
continue;
187-
}
188-
generator.applySourceMap(
189-
new SourceMapConsumer(jsonFiles[j].sourceMap),
190-
jsonFiles[j].path.substr(1));
191-
}
192-
applySourceMap(outputFiles[i], generator.toString());
176+
applySourceMap(outputFiles[i], outputFiles[i].sourceMap);
193177
}
194178
this.push(outputFiles[i]);
195179
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"dependencies": {
3939
"chalk": "^1.0.0",
4040
"gulp-util": "^3.0.7",
41-
"source-map": "^0.5.3",
4241
"vinyl-fs": "^2.2.1",
4342
"vinyl-sourcemaps-apply": "^0.2.0"
4443
},

0 commit comments

Comments
 (0)