Last active
August 29, 2015 13:56
-
-
Save zoerooney/9119546 to your computer and use it in GitHub Desktop.
current Gulp configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"repository": { | |
"type": "git", | |
"url": "https://github.com/zoerooney/Emi" | |
}, | |
"dependencies": { | |
"gulp": "*", | |
"gulp-ruby-sass": "*", | |
"gulp-autoprefixer": "*", | |
"gulp-minify-css": "*", | |
"gulp-livereload": "*" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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