Sass Build Task

Compile your Sass sources into a CSS bundle.

API

sassBuild([options])

Returns a stream of Vinyl files that can be piped.

Available options:

  • src (String|Array) Glob or array of globs (What's a glob?) matching Sass entry files. Default: 'app/theme/app.+(ios|md|wp).scss'.
  • dest (String) Output path for the compiled CSS bundle(s). Default: 'www/build/css'.
  • sassOptions (Object) Sass options. Default:
{
  includePaths: [
    'node_modules/ionic-angular',
    'node_modules/ionicons/dist/scss'
  ]
}
{
  browsers: [
    'last 2 versions',
    'iOS >= 7',
    'Android >= 4',
    'Explorer >= 10',
    'ExplorerMobile >= 11'
  ],
  cascade: false
}
  • onError (Function) Error handler when there are errors in the Sass stream. Default:
function(err) {
  console.error(err.message);
  this.emit('end');
}

Example

var sassBuild = require('ionic-gulp-sass-build');

gulp.task('sass', sassBuild);

gulp.task('sass', function(){
  return sassBuild({
    dest: 'www/my-custom-build-dir',
    sassOptions: {
      includePaths: [
        'node_modules/ionic-angular',
        'node_modules/ionicons/dist/scss',
        'node_modules/bootstrap-sass'
      ]
    }
  });
});