Go to file
Vincent Prouillet 598d16f974 Merge pull request #248 from Snugug/feature/contributing
Add Contributing Guidelines
2015-05-06 15:59:04 +01:00
test Merge pull request #228 from Snugug/2.x-datastream 2015-04-01 16:59:50 -07:00
.editorconfig Added linting 2015-03-24 05:32:12 -05:00
.eslintrc Added linting 2015-03-24 05:32:12 -05:00
.gitignore Add node_modules to gitignore 2013-12-14 18:23:28 -08:00
.npmignore Version 1.3.1 2015-01-13 20:49:16 -08:00
.travis.yml Rewrite gulp-sass to be a very light wrapper 2015-03-23 22:30:52 +00:00
CHANGELOG.md 🎨 Update formatting of CHANGELOG entry 2015-04-30 07:13:41 -04:00
CONTRIBUTING.md 🔥 Remove reference to branch 2015-05-05 08:56:08 -04:00
LICENSE Initial commit 2013-08-31 14:01:20 -07:00
README.md Removed from the examples as logging is now done through 2015-03-30 09:54:24 -04:00
index.js Allow you to change the compiler and expose it 2015-04-14 12:23:54 -04:00
package.json ⬆️ Update Node Sass to 3.0 2015-05-06 10:31:25 -04:00

README.md

gulp-sass Build Status Join the chat at https://gitter.im/dlmanning/gulp-sass

Sass plugin for Gulp.

Install

npm install gulp-sass --save-dev

Basic Usage

Something like this will compile your Sass files:

var gulp = require('gulp');
var sass = require('gulp-sass');

gulp.task('sass', function () {
	gulp.src('./scss/*.scss')
		.pipe(sass().on('error', sass.logError))
		.pipe(gulp.dest('./css'));
});

You can also compile synchronously, doing something like this:

var gulp = require('gulp');
var sass = require('gulp-sass');

gulp.task('sass', function () {
  gulp.src('./scss/*.scss')
    .pipe(sass.sync().on('error', sass.logError))
    .pipe(gulp.dest('./css'));
});

Options

Pass in options just like you would for node-sass; they will be passed along just as if you were using node-sass.

Source Maps

gulp-sass can be used in tandem with gulp-sourcemaps to generate source maps for the Sass to CSS compilation. You will need to initialize gulp-sourcemaps prior to running gulp-sass and write the source maps after.

var sourcemaps = require('gulp-sourcemaps');

gulp.src('./scss/*.scss')
  .pipe(sourcemaps.init())
    .pipe(sass())
  .pipe(sourcemaps.write())
  .pipe(gulp.dest('./css'));

By default, gulp-sourcemaps writes the source maps inline in the compiled CSS files. To write them to a separate file, specify a path relative to the gulp.dest() destination in the sourcemaps.write() function.

var sourcemaps = require('gulp-sourcemaps');

gulp.src('./scss/*.scss')
  .pipe(sourcemaps.init())
    .pipe(sass())
  .pipe(sourcemaps.write('./maps'))
  .pipe(gulp.dest('./css'));

Issues

gulp-sass is a very light-weight wrapper around node-sass, which in turn is a Node binding for libsass, which in turn is a port of Sass. Because of this, the issue you're having likely isn't a gulp-sass issue, but an issue with one of those three projects.

If you have a feature request/question how Sass works/concerns on how your Sass gets compiled/errors in your compiling, it's likely a libsass or Sass issue and you should file your issue with one of those projects.

If you're having problems with the options you're passing in, it's likely a node-sass or libsass issued and you should file your issue with one of those projects.

We may, in the course of resolving issues, direct you to one of these other projects. If we do so, please follow up by searching that project's issue queue (both open and closed) for your problem and, if it doesn't exist, filing an issue with them.