Skip to content

Instantly share code, notes, and snippets.

@zoerooney
Last active August 29, 2015 13:56
Show Gist options
  • Save zoerooney/9119546 to your computer and use it in GitHub Desktop.
Save zoerooney/9119546 to your computer and use it in GitHub Desktop.
current Gulp configuration
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
livereload = require('gulp-livereload');
gulp.task('styles', function(){
return sass('scss/')
.on('error', function (err) {
console.error('Error!', err.message);
})
.pipe(gulp.dest(''))
.pipe(autoprefixer())
.pipe(minifycss())
.pipe(gulp.dest(''))
.pipe(livereload());
});
gulp.task('default',['styles']);
gulp.task('watch', function() {
livereload.listen();
// Watch .scss files
gulp.watch('scss/*.scss', ['styles']);
gulp.watch('scss/**/*.scss', ['styles']);
});
{
"repository": {
"type": "git",
"url": "https://github.com/zoerooney/Emi"
},
"dependencies": {
"gulp": "*",
"gulp-ruby-sass": "*",
"gulp-autoprefixer": "*",
"gulp-minify-css": "*",
"gulp-livereload": "*"
}
}
@zoerooney
Copy link
Author

To run the default task, make sure you're in the project directory in your command line tool and type gulp

To run the watch task, type gulp watch

You will get errors if you have any missing stuff, like missing npm modules or if you don't have Sass installed (or if you don't have gulp installed).

I usually have two Terminal instances running, one for the watch task and another for manual stuff like git commands

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