Created
November 13, 2014 11:44
-
-
Save taksenov/6241f48593cc10a4fda0 to your computer and use it in GitHub Desktop.
Скрипт для запуска livereloada средствами gulp
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
/** | |
* Created by taksenov on 12.09.2014. | |
*/ | |
'use strict'; | |
var gulp = require('gulp'), | |
livereload = require('gulp-livereload'), | |
connect = require('gulp-connect'); | |
gulp.task('connect', function() { | |
connect.server({ | |
root: '', | |
livereload: true | |
}); | |
}); | |
gulp.task('html', function () { | |
gulp.src('index.html') | |
.pipe(connect.reload()); | |
}); | |
gulp.task('less', function () { | |
gulp.src('./dev/css/*.less') | |
.pipe(connect.reload()); | |
}); | |
gulp.task('css', function () { | |
gulp.src('./dev/css/*.css') | |
.pipe(connect.reload()); | |
}); | |
gulp.task('watch', function () { | |
livereload.listen(); | |
gulp.watch('index.html').on('change', livereload.changed); | |
gulp.watch('./dev/css/*.less').on('change', livereload.changed); | |
gulp.watch('./dev/css/*.css').on('change', livereload.changed); | |
}); | |
gulp.task('default', ['connect', 'html', 'less', 'css', 'watch']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment