Created
January 12, 2014 20:12
-
-
Save yoshuawuyts/8389794 to your computer and use it in GitHub Desktop.
This file contains hidden or 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'); | |
var stylus = require('gulp-stylus'); | |
var refresh = require('gulp-livereload'); | |
var lr = require('tiny-lr'); | |
var server = lr(); | |
gulp.task('stylus', function(){ | |
gulp.src('assets/stylus/main.styl') | |
.pipe(stylus({ | |
use: ['nib'], | |
compress: true | |
})) | |
.pipe(gulp.dest('assets/css')) | |
.pipe(refresh(server)) | |
}); | |
gulp.task('js', function(){ | |
gulp.src('assets/js/*.js') | |
.pipe(refresh(server)); | |
}) | |
gulp.task('php', function(){ | |
gulp.src('*.php') | |
.pipe(refresh(server)); | |
}) | |
gulp.task('livereload', function(){ | |
server.listen(35729, function(err){ | |
if(err) return console.log(err); | |
}); | |
}); | |
gulp.task('dev', function(){ | |
gulp.run('livereload', 'stylus'); | |
gulp.watch('assets/stylus/**' , function(ev){ | |
gulp.run('stylus') | |
}); | |
gulp.watch('assets/js/*.js', function(ev){ | |
gulp.run('js') | |
}); | |
gulp.watch('*.php', function(ev){ | |
gulp.run('php') | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment