Skip to content

Commit 2266a2c

Browse files
committedDec 30, 2017
Drop dependency on deprecated gulp-util
1 parent c417176 commit 2266a2c

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed
 

‎index.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
2-
var gutil = require('gulp-util');
2+
var PluginError = require('plugin-error');
3+
var Vinyl = require('vinyl');
34
var path = require('path');
45
var rework = require('rework');
56
var reworkImport = require('rework-import');
@@ -23,7 +24,7 @@ module.exports = function(destFile, options) {
2324
var processedCss;
2425

2526
if (file.isStream()) {
26-
this.emit('error', new gutil.PluginError('gulp-concat-css', 'Streaming not supported'));
27+
this.emit('error', new PluginError('gulp-concat-css', 'Streaming not supported'));
2728
return cb();
2829
}
2930

@@ -99,7 +100,7 @@ module.exports = function(destFile, options) {
99100

100101
processedCss = processedCss.toString();
101102
} catch(err) {
102-
this.emit('error', new gutil.PluginError('gulp-concat-css', err));
103+
this.emit('error', new PluginError('gulp-concat-css', err));
103104
return cb();
104105
}
105106

@@ -112,9 +113,9 @@ module.exports = function(destFile, options) {
112113

113114
var contents = urlImportRules.map(function(rule) {
114115
return '@import ' + rule.import + ';';
115-
}).concat(buffer).join(gutil.linefeed);
116+
}).concat(buffer).join('\n');
116117

117-
var concatenatedFile = new gutil.File({
118+
var concatenatedFile = new Vinyl({
118119
base: firstFile.base,
119120
cwd: firstFile.cwd,
120121
path: path.join(firstFile.base, destFile),

‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
}
2121
],
2222
"dependencies": {
23-
"gulp-util": "~3.0.1",
2423
"lodash.defaults": "^3.0.0",
2524
"parse-import": "^2.0.0",
25+
"plugin-error": "^0.1.2",
2626
"rework": "~1.0.0",
2727
"rework-import": "^2.0.0",
2828
"rework-plugin-url": "^1.0.1",
29-
"through2": "~1.1.1"
29+
"through2": "~1.1.1",
30+
"vinyl": "^2.1.0"
3031
},
3132
"devDependencies": {
3233
"chai": "^1.10.0",

‎test/test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var expect = require('chai').expect,
22
through = require('through2'),
3-
gutil = require('gulp-util'),
3+
Vinyl = require('vinyl'),
44
fs = require('fs'),
55
path = require('path'),
66
concatCss = require('../');
@@ -9,7 +9,7 @@ var expect = require('chai').expect,
99
function expected(file) {
1010
var base = path.join(process.cwd(), 'test/expected');
1111
var filepath = path.resolve(base, file);
12-
return new gutil.File({
12+
return new Vinyl({
1313
path: filepath,
1414
cwd: process.cwd(),
1515
base: base,
@@ -20,7 +20,7 @@ function expected(file) {
2020
function fixture(file) {
2121
var base = path.join(process.cwd(), 'test/fixtures');
2222
var filepath = path.join(base, file);
23-
return new gutil.File({
23+
return new Vinyl({
2424
path: filepath,
2525
cwd: process.cwd(),
2626
base: base,

0 commit comments

Comments
 (0)
Please sign in to comment.