Skip to content
Closed
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ results

npm-debug.log
node_modules
yarn.lock
package-lock.json

.idea
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: node_js
node_js:
- "0.10"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node sass still officiallly supports 0.10, 0.12, and iojs. It's not tested in Travis but is tested locally before releases.

- node
- iojs
- "lts/argon"
- "lts/boron"
- "lts/carbon"
- "node"
sudo: false
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Gulp Sass Changelog

## v4.0.0
**Upcoming**

* **Breaking change** Drop support for Node for versions that reached end of life (`< 4`).

## v3.1.0
**January 9, 2017**

* **Change** ⬆️ Bump to Node Sass 4.2.0

## v3.0.0
**December 10, 2016**

* **Breaking change** ⬆️ Bump to Node Sass 4.0.0

## v2.3.2
**June 15, 2016**

* **Fix** Prevent options from leaking between compilations
* **Chore** Update dependencies

## v2.1.0 to v2.3.1

(missing, please open a PR if you wish to fill the gap)

## v2.1.0-beta
**September 21, 2015**

Expand Down
21 changes: 12 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
'use strict';

var gutil = require('gulp-util');
var chalk = require('chalk');
var PluginError = require('plugin-error');
var replaceExtension = require('replace-ext');
var stripAnsi = require('strip-ansi');
var through = require('through2');
var clonedeep = require('lodash.clonedeep');
var path = require('path');
Expand All @@ -23,13 +26,13 @@ var gulpSass = function gulpSass(options, sync) {
return cb(null, file);
}
if (file.isStream()) {
return cb(new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported'));
return cb(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
}
if (path.basename(file.path).indexOf('_') === 0) {
return cb();
}
if (!file.contents.length) {
file.path = gutil.replaceExtension(file.path, '.css');
file.path = replaceExtension(file.path, '.css');
return cb(null, file);
}

Expand Down Expand Up @@ -100,13 +103,13 @@ var gulpSass = function gulpSass(options, sync) {
});

// Replace the map file with the original file name (but new extension)
sassMap.file = gutil.replaceExtension(sassFileSrc, '.css');
sassMap.file = replaceExtension(sassFileSrc, '.css');
// Apply the map
applySourceMap(file, sassMap);
}

file.contents = sassObj.css;
file.path = gutil.replaceExtension(file.path, '.css');
file.path = replaceExtension(file.path, '.css');

cb(null, file);
};
Expand All @@ -122,16 +125,16 @@ var gulpSass = function gulpSass(options, sync) {
filePath = filePath ? filePath : file.path;
relativePath = path.relative(process.cwd(), filePath);

message += gutil.colors.underline(relativePath) + '\n';
message += chalk.underline(relativePath) + '\n';
message += error.formatted;

error.messageFormatted = message;
error.messageOriginal = error.message;
error.message = gutil.colors.stripColor(message);
error.message = stripAnsi(message);

error.relativePath = relativePath;

return cb(new gutil.PluginError(
return cb(new PluginError(
PLUGIN_NAME, error
));
};
Expand Down Expand Up @@ -176,7 +179,7 @@ gulpSass.sync = function sync(options) {
// Log errors nicely
//////////////////////////////
gulpSass.logError = function logError(error) {
var message = new gutil.PluginError('sass', error.messageFormatted).toString();
var message = new PluginError('sass', error.messageFormatted).toString();
process.stderr.write(message + '\n');
this.emit('end');
};
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp-sass",
"version": "3.1.0",
"version": "4.0.0",
"description": "Gulp plugin for sass",
"main": "index.js",
"scripts": {
Expand All @@ -20,10 +20,16 @@
"bugs": {
"url": "https://github.com/dlmanning/gulp-sass/issues"
},
"engines": {
"node": ">=4.0.0"
},
"dependencies": {
"gulp-util": "^3.0",
"chalk": "^2.3.0",
"lodash.clonedeep": "^4.3.2",
"node-sass": "^4.2.0",
"plugin-error": "^0.1.2",
"replace-ext": "^1.0.0",
"strip-ansi": "^4.0.0",
"through2": "^2.0.0",
"vinyl-sourcemaps-apply": "^0.2.0"
},
Expand All @@ -37,6 +43,7 @@
"gulp-tap": "^0.1.3",
"mocha": "^2.2.1",
"rimraf": "^2.4.3",
"should": "^8.3.1"
"should": "^8.3.1",
"vinyl": "^2.1.0"
}
}
4 changes: 2 additions & 2 deletions test/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var should = require('should');
var gutil = require('gulp-util');
var Vinyl = require('vinyl');
var path = require('path');
var fs = require('fs');
var sass = require('../index');
Expand All @@ -17,7 +17,7 @@ var createVinyl = function createVinyl(filename, contents) {
var base = path.join(__dirname, 'scss');
var filePath = path.join(base, filename);

return new gutil.File({
return new Vinyl({
'cwd': __dirname,
'base': base,
'path': filePath,
Expand Down