Answer the question
In order to leave comments, you need to log in
Why is an error displayed when executing several tasks in one?
There is a task:
gulp.task('watch',['browser-sync','prefix'],function(){
gulp.watch('fashion/*.html');
});
and when you run this task, an error is displayed:
browser-sync and prefix separately run without problems.
Answer the question
In order to leave comments, you need to log in
You are using version 3 Gulp
.
To solve your problem, you need:
If you want to take a step on the first option, you will have to enter this command into the console: npm uninstall -g gulp && npm i -g [email protected]
and your code will work.
Otherwise, leave yours Gulp 4
and follow this link and read the instructions.
Here is the code for you Gulp 4
:
gulp.task('watch', function(){
browserSync.init({
сюда конфиг вашего сервера
});
gulp.watch("Путь к файлам Html", gulp.series('html')); // <--- В кавычках название таска
gulp.watch("Путь к файлам CSS", gulp.series('prefix'));
})
parallel
and series
. That is, in the first case, your task
-and in the thread are executed together. And in another case, the first one will be executed first task
, then the second, the third and to the end.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question