So mine is a pretty simple gulp file.
const gulp = require("gulp");
const ap = require("gulp-autoprefixer");
function styles() {
return gulp
.src("./style.css")
.pipe(ap("last 2 versions"))
.pipe(gulp.dest("./dist"));
}
function watch() {
gulp.watch("./style.css", styles);
}
exports.watch = watch;
exports.styles = styles;
exports.default = watch;
Running the styles task independently does produce the autoprefixed css.
The watch task however gets stuck on Starting 'watch'...
Can someone tell me what's wrong.
Gulp CLI Version: 2.0.1 Gulp Local Version: 4.0.0 Node: 10.15.0 OS: Windows 10 (WSL)
watchtask will only run when the file changes. Do you mean that thestylestask doesn't run when you alter and save the file? - TheDancingCodegulp.series(styles))doesn't work. - Saif Al Falahstylestask won't run when you start thewatchtask, but only when you change and save thestyle.cssfile. - TheDancingCode