javascript - Gulp.js won't reload plain CSS -
javascript - Gulp.js won't reload plain CSS -
this gulpfile:
var gulp = require('gulp'), watch = require('gulp-watch'), livereload = require('gulp-livereload'); gulp.task('watch', function() { livereload.listen(); gulp.watch('./css/**/*.css', ['css']).on('change', livereload.changed); gulp.watch('./js/**/*.js', ['js']).on('change', livereload.changed); gulp.watch('./**/*.php').on('change', livereload.changed); }); gulp.task('default', [ 'watch']);
it reload css 1 time , crash error:
[15:30:13] style.css reloaded. [15:30:13] task 'css' not in gulpfile [15:30:13] please check documentation proper gulpfile formatting
not sure create of this, had similar issues?
first need create task things want css
gulp.task('css', function() { homecoming gulp.src('./css/**/*.css') .pipe(livereload()); });
then watch file, if changed, run task again.
gulp.task('watch', function() { livereload.listen(); gulp.watch('./css/**/*.css', ['css']); }); gulp.task('default', [ 'watch']);
javascript css gulp gulp-watch
Comments
Post a Comment