a gulp plugin for compilation of Sass to CSS.
gulp-sass
is a gulp plugin for compilation of Sass files to CSS files.
Basic example of usage:
var gulp = require('gulp');
var sass = require('gulp-sass');
gulp.task('sass', function () {
gulp.src('./sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css'));
});
The plugin can also be used with gulp-sourcemaps
:
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('sass', function () {
gulp.src('./sass/*.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sourcemaps.write('./sourcemaps'))
.pipe(gulp.dest('./css'));
});
gulp-sass
accepts node-sass
compatible options, e.g.:
var gulp = require('gulp');
var sass = require('gulp-sass');
gulp.task('sass', function () {
gulp.src('./sass/**/*.scss')
.pipe(sass({ outputStyle: 'compressed' }))
.pipe(gulp.dest('./css'));
});