Created
December 29, 2013 11:48
-
-
Save fenbox/8169603 to your computer and use it in GitHub Desktop.
sample gulp config: gulpfile.js
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
// Include gulp | |
var gulp = require('gulp'); | |
// Include Our Plugins | |
var sass = require('gulp-sass'); | |
var lr = require('tiny-lr'), | |
refresh = require('gulp-livereload'), | |
server = lr(); | |
// Task SASS | |
gulp.task('sass', function() { | |
gulp.src([ | |
'scss/**/*.scss', | |
'!scss/**/_*.scss' | |
]) | |
.pipe(sass({ | |
includePaths: ['scss'] | |
})) | |
.pipe(gulp.dest('css')) | |
.pipe(refresh(server)); | |
}); | |
gulp.task('refresh', function() { | |
gulp.src([ | |
'**/*.html', | |
'**/*.php' | |
]) | |
.pipe(refresh(server)); | |
}); | |
// Task: default | |
gulp.task('default', function() { | |
gulp.run('sass'); | |
server.listen(35729, function (error) { | |
if (error) return console.log(error); | |
gulp.watch([ | |
'scss/**', | |
'img/**' | |
], function(event) { | |
gulp.run('sass'); | |
}); | |
gulp.watch([ | |
'**/*.html', | |
'**.php' | |
], function(event) { | |
gulp.run('refresh'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for sharing~