gulp-sassport
v0.4.0
Published
Sassport gulp plugin
Downloads
8
Maintainers
Readme
Gulp-Sassport
Gulp plugin for the Sassport tool. Gulp-Sassport is a light wrapper for gulp-sass, so its usage is very similar to Gulp-Sass.
Installation
npm install gulp-sassport --save-dev
Basic Usage
var gulp = require('gulp');
var sassport = require('gulp-sassport');
// Use any Sassport modules
var fooModule = require('path/to/any-sassport-module.js');
gulp.task('sass', function() {
return gulp.src('./sass/**/*.scss')
.pipe(sassport([ fooModule ], {
outputStyle: 'compressed'
}))
.pipe(gulp.dest('./css'));
});
gulp.task('sass:watch', function() {
gulp.watch('./sass/**/*.scss', ['sass']);
});
Options
Gulp-Sassport can be called with three arguments (all optional):
- An array of Sassport modules
- Node-Sass options
- Sassport options
gulp.task('sass', function() {
return gulp.src('./sass/**/*.scss')
.pipe(sassport(
[ require('sassport-reference') ], // Sassport modules
{ outputStyle: 'compressed' } // Sass options
))
.pipe(gulp.dest('./css'));
});
API
Gulp-Sassport is fully extensible, as if it were a Sassport module, with these methods:
sassport(...).assets(localPath, remotePath)
sassport(...).functions(functionMap)
sassport(...).loaders(loaderMap)
sassport(...).exports(exportMap)
sassport(...).variables(variableMap)
EXAMPLE:
gulp.task('sass', function() {
return gulp.src('./sass/**/*.scss')
.pipe(sassport([], { outputStyle: 'compressed' })
.assets(__dirname + '/assets', 'public/assets')
)
.pipe(gulp.dest('./css'));
});
See the Sassport documentation for more info.