biotope / biotope-build

Biotope Build Framework
https://build.biotope.sh
MIT License
24 stars 10 forks source link

Livereload and htmlhint triggers multiple times #32

Closed alxbenz closed 6 years ago

alxbenz commented 6 years ago

While running certain tasks (e.g. sass, hb:static) the livereload and htmlhint tasks trigger multiple times causing the site to reload several times.

alxbenz commented 6 years ago

Possible solution: maybe remove the watch task for livereload and html hint and explicitly trigger each task after each of the other tasks.

luiswill commented 6 years ago

Would it be possible to only let .scss files through the sass task if a file has been changed since last run ? So that the reload is faster Maybe thanks to gulp-newer ?

Example :

.gulp.src(..)
.pipe(newer(DEST_FOLDER))  
// here continue with all changed .scss files
.pipe(..)
janrembold commented 6 years ago

@alxbenz I don't understand the connection between htmlhint and livereload. I thought htmlhint is a read-only task. But anyway it is a good idea to add htmlhint to the runSequence of the static:hb watch task!

I fear that moving the livereload watch task from its currently global approach (watch all in one task) to a local on like "everybody is responsible for its own reloading" leads to much more complicated code.

@luiswill We already use gulp-cached, that as far as I know, does the same as gulp-newer. See https://github.com/frontend-framework/build-framework/blob/master/tasks/htmlhint.js#L12 for an example in htmlhint task

janrembold commented 6 years ago

@alxbenz didn't you fix this already in 5.2.x? Or are there still issues? Please close if already fixed...

timomayer commented 6 years ago

Think this is fixed but was not closed

alxbenz commented 6 years ago

Yes, this has been fixed already.