Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions lib/gulp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ module.exports = function(initOptions) {
var PLUGIN_NAME = 'gulp-google-closure-compiler';

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

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

for (var i = 0; i < outputFiles.length; i++) {
if (outputFiles[i].sourceMap) {
// Closure compiler does not compose source maps (use input source maps)
// We need to manually compose the maps so that we reference the original file
var generator = SourceMapGenerator.fromSourceMap(
new SourceMapConsumer(outputFiles[i].sourceMap));
outputFiles[i].sourceMap = undefined;

for (var j = 0; j < jsonFiles.length; j++) {
if (!jsonFiles[j].sourceMap) {
continue;
}
generator.applySourceMap(
new SourceMapConsumer(jsonFiles[j].sourceMap),
jsonFiles[j].path.substr(1));
}
applySourceMap(outputFiles[i], generator.toString());
applySourceMap(outputFiles[i], outputFiles[i].sourceMap);
}
this.push(outputFiles[i]);
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"dependencies": {
"chalk": "^1.0.0",
"gulp-util": "^3.0.7",
"source-map": "^0.5.3",
"vinyl-fs": "^2.2.1",
"vinyl-sourcemaps-apply": "^0.2.0"
},
Expand Down