Skip to content

Commit

Permalink
replaced deprecated gulp-util (#34)
Browse files Browse the repository at this point in the history
* replaced deprecated gulp-util

* removed package-lock.json
  • Loading branch information
zbennett10 authored and hustxiaoc committed Jun 11, 2018
1 parent eeda4cf commit fb84eb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
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": "taojie.hjp@taobao.com",
"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

0 comments on commit fb84eb3

Please sign in to comment.