Skip to content

Commit

Permalink
Merge pull request #238 from sarenji/2.x
Browse files Browse the repository at this point in the history
Allow you to change the compiler and expose it
  • Loading branch information
Snugug committed Apr 29, 2015
2 parents 2b21a49 + c1d629c commit 33aa1f7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var gutil = require('gulp-util');
var through = require('through2');
var assign = require('object-assign');
var path = require('path');
var sass = require('node-sass');
var applySourceMap = require('vinyl-sourcemaps-apply');

var PLUGIN_NAME = 'gulp-sass';
Expand Down Expand Up @@ -117,14 +116,14 @@ var gulpSass = function gulpSass(options, sync) {
filePush(obj);
};

sass.render(opts, callback);
gulpSass.compiler.render(opts, callback);
}
else {
//////////////////////////////
// Sync Sass render
//////////////////////////////
try {
result = sass.renderSync(opts);
result = gulpSass.compiler.renderSync(opts);

filePush(result);
}
Expand All @@ -149,4 +148,9 @@ gulpSass.logError = function logError(error) {
gutil.log(gutil.colors.red('[' + PLUGIN_NAME + '] ') + error.message);
};

//////////////////////////////
// Store compiler in a prop
//////////////////////////////
gulpSass.compiler = require('node-sass');

module.exports = gulpSass;

0 comments on commit 33aa1f7

Please sign in to comment.