From e91b7bc06fa75b289d1a8c9cab71dad80478f4bf Mon Sep 17 00:00:00 2001 From: Kim Ward Date: Fri, 5 Jan 2018 09:04:35 -0600 Subject: [PATCH] Replaced deprecated module gulp-util with vinyl --- index.js | 4 ++-- package.json | 4 ++-- test/main.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 61ab1ec..c3ba232 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ var path = require('path'); var sizeOf = require('image-size'); var mustache = require('mustache'); var through = require('through'); -var gutil = require('gulp-util'); +var Vinyl = require('vinyl'); var mime = require('mime'); var SVGO = require('svgo'); var svgo = new SVGO(); @@ -55,7 +55,7 @@ module.exports = function(opts) { }; var endStream = function() { - this.emit('data', new gutil.File({ + this.emit('data', new Vinyl({ contents: new Buffer(mustache.render(tpl, { items: buffer }), 'utf8'), diff --git a/package.json b/package.json index c579d04..98c0d67 100644 --- a/package.json +++ b/package.json @@ -23,13 +23,13 @@ }, "main": "index.js", "dependencies": { - "gulp-util": "~2.2.14", "image-size": "^0.4.0", "imagesize": "~1.0.0", "mime": "~1.2.11", "mustache": "~0.8.1", "svgo": "^0.5.0", - "through": "~2.3.4" + "through": "~2.3.4", + "vinyl": "^2.1.0" }, "devDependencies": { "mocha": "~1.18.2", diff --git a/test/main.js b/test/main.js index c7a2916..50c6666 100644 --- a/test/main.js +++ b/test/main.js @@ -1,12 +1,12 @@ var baseimg = require('../'); -var gutil = require('gulp-util'); +var Vinyl = require('vinyl'); var should = require('should'); var fs = require('fs'); var postcss = require('postcss'); require('mocha'); var loadFile = function(path) { - return new gutil.File({ + return new Vinyl({ path: path, contents: fs.readFileSync(path) });