Skip to content

Instantly share code, notes, and snippets.

@phpmypython
Last active August 29, 2015 14:12
Show Gist options
  • Select an option

  • Save phpmypython/79d114316fe4dcd7831e to your computer and use it in GitHub Desktop.

Select an option

Save phpmypython/79d114316fe4dcd7831e to your computer and use it in GitHub Desktop.
var gulp = require('gulp'),
scss = require('gulp-sass'),
notify = require('gulp-notify');
autoprefixer = require('gulp-autoprefixer');
minifyCss = require('gulp-minify-css');
gulp.task('styles', function () {
return gulp.src('scss/main.scss') //This is the path to SCSS files that you want to compile.
.pipe(scss())
.pipe(autoprefixer({
browsers: ['last 4 versions'],
cascade: false
}))
.pipe(minifyCss({compatibility: 'ie8'}))
.pipe(gulp.dest('css/')) //This is the path to where you want the css output.
//.pipe(livereload())
.pipe(notify({
message: "SCSS Compiled."
}));
});
gulp.task('watch', function () {
//livereload.listen();
gulp.watch('scss/*.scss',['styles']);
gulp.watch('scss/*/*.scss', ['styles']); //This watches the directory where the SCSS is and upon changes it will run the styles task
});
//The default Gulp task so we can kick it off by just running "gulp"
gulp.task('build',['styles']);
gulp.task('default', ['styles','watch']);
@phpmypython
Copy link
Author

Added Auto-Prefixing and minification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment