Skip to content
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
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';
var through = require('through2'),
uglify = require('uglify-es'),
gutil = require('gulp-util'),
minimatch = require('minimatch'),
path = require('path'),
PluginError = gutil.PluginError,
File = require('vinyl'),
PluginError = require('plugin-error'),
colors = require('ansi-colors'),
reSourceMapComment = /\n\/\/# sourceMappingURL=.+?$/,
pathSeparatorRe = /[\/\\]/g;

Expand Down Expand Up @@ -39,9 +40,9 @@ function formatError(error, file) {
filePath = filePath ? filePath : file.path;
relativePath = path.relative(process.cwd(), filePath);

message += gutil.colors.underline(relativePath) + '\n';
message += colors.underline(relativePath) + '\n';
message += error.message + ' (line: ' + error.line + ', col: ' + error.col + ', pos: ' + error.pos;
error.message = gutil.colors.red(message);
error.message = colors.red(message);
return error;
}

Expand Down Expand Up @@ -104,7 +105,7 @@ module.exports = function(opt) {
}
options.fromString = options.hasOwnProperty("fromString") ? options.fromString : true;

var min_file = new gutil.File({
var min_file = new File({
path: Array.isArray(ext.min) ? file.path.replace(ext.min[0], ext.min[1]) : file.path.replace(/\.js$/, ext.min),
base: file.base
});
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
},
"author": "[email protected]",
"dependencies": {
"gulp-util": "^2.2.14",
"ansi-colors": "^1.0.1",
"minimatch": "^3.0.2",
"plugin-error": "^0.1.2",
"through2": "^0.4.0",
"uglify-es": "^3.0.3"
"uglify-es": "^3.0.3",
"vinyl": "^2.1.0"
},
"license": "ISC",
"bugs": {
Expand Down