Skip to content

Instantly share code, notes, and snippets.

@JoanClaret
Created February 16, 2016 13:24
Show Gist options
  • Save JoanClaret/588d2e35dc412e868635 to your computer and use it in GitHub Desktop.
Save JoanClaret/588d2e35dc412e868635 to your computer and use it in GitHub Desktop.
send variable to gulp
var isProduction = true;
if(gutil.env.production === true) {
isProduction = true;
}
gulp.task('sass-private', function () {
return gulp.src('resources/assets/scss/styles-private.scss')
.pipe(plumber({errorHandler: onError}))
.pipe(sass({compress: false}).on('error', gutil.log))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(isProduction ? cssnano() : gutil.noop())
.pipe(rename("private.css"))
.pipe(gulp.dest('public/css'))
.pipe(livereload())
// create version files
.on('end', function() {
gulp.start('version');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment