Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mariocasciaro/gulp-concat-css
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c4171769510e6921b7c33610acfb6fd6a42237be
Choose a base ref
...
head repository: mariocasciaro/gulp-concat-css
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8d11ad59c1120e860f458dc1a463278c359f03c9
Choose a head ref
  • 3 commits
  • 3 files changed
  • 3 contributors

Commits on Dec 30, 2017

  1. Copy the full SHA
    2266a2c View commit details

Commits on Jan 2, 2018

  1. Merge pull request #44 from TheDancingCode/pr/remove-gutil

    Drop dependency on deprecated `gulp-util`
    mariocasciaro authored Jan 2, 2018
    Copy the full SHA
    e8f7ad3 View commit details
  2. 3.0.0

    mariocasciaro committed Jan 2, 2018
    Copy the full SHA
    8d11ad5 View commit details
Showing with 13 additions and 11 deletions.
  1. +6 −5 index.js
  2. +4 −3 package.json
  3. +3 −3 test/test.js
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
var gutil = require('gulp-util');
var PluginError = require('plugin-error');
var Vinyl = require('vinyl');
var path = require('path');
var rework = require('rework');
var reworkImport = require('rework-import');
@@ -23,7 +24,7 @@ module.exports = function(destFile, options) {
var processedCss;

if (file.isStream()) {
this.emit('error', new gutil.PluginError('gulp-concat-css', 'Streaming not supported'));
this.emit('error', new PluginError('gulp-concat-css', 'Streaming not supported'));
return cb();
}

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

processedCss = processedCss.toString();
} catch(err) {
this.emit('error', new gutil.PluginError('gulp-concat-css', err));
this.emit('error', new PluginError('gulp-concat-css', err));
return cb();
}

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

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

var concatenatedFile = new gutil.File({
var concatenatedFile = new Vinyl({
base: firstFile.base,
cwd: firstFile.cwd,
path: path.join(firstFile.base, destFile),
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gulp-concat-css",
"description": "Concatenate css files, rebasing urls and inlining @import",
"version": "2.3.0",
"version": "3.0.0",
"homepage": "https://github.com/mariocasciaro/gulp-concat-css",
"author": {
"name": "Mario Casciaro"
@@ -20,13 +20,14 @@
}
],
"dependencies": {
"gulp-util": "~3.0.1",
"lodash.defaults": "^3.0.0",
"parse-import": "^2.0.0",
"plugin-error": "^0.1.2",
"rework": "~1.0.0",
"rework-import": "^2.0.0",
"rework-plugin-url": "^1.0.1",
"through2": "~1.1.1"
"through2": "~1.1.1",
"vinyl": "^2.1.0"
},
"devDependencies": {
"chai": "^1.10.0",
6 changes: 3 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var expect = require('chai').expect,
through = require('through2'),
gutil = require('gulp-util'),
Vinyl = require('vinyl'),
fs = require('fs'),
path = require('path'),
concatCss = require('../');
@@ -9,7 +9,7 @@ var expect = require('chai').expect,
function expected(file) {
var base = path.join(process.cwd(), 'test/expected');
var filepath = path.resolve(base, file);
return new gutil.File({
return new Vinyl({
path: filepath,
cwd: process.cwd(),
base: base,
@@ -20,7 +20,7 @@ function expected(file) {
function fixture(file) {
var base = path.join(process.cwd(), 'test/fixtures');
var filepath = path.join(base, file);
return new gutil.File({
return new Vinyl({
path: filepath,
cwd: process.cwd(),
base: base,