Answer the question
In order to leave comments, you need to log in
How to set up Gulpfile.js?
gulpfile looks like this:
var gulp = require('gulp'),
less = require("gulp-less");
browserSync = require("browser-sync");
gulp.task("less", function() {
return gulp.src("app/less/main.less")
.pipe(less())
.pipe(gulp.dest("app/css"))
.pipe(browserSync.reload({stream: true}))
});
gulp.task("browser-sync", function() {
browserSync ({
server: {
baseDir: "app"
},
});
});
gulp.task("watch", function() {
gulp.watch("app/less/**/*.less", gulp.series("less"));
});
gulp.task("default", gulp.series(gulp.parallel("less", "browser-sync"), "watch"));
$ gulp
[18:48:19] Using gulpfile c:\Users\Ant\Desktop\HTML\Exercises\gulpfile.js
[18:48:19] Starting 'default'...
[18:48:19] Starting 'less'...
[18:48:19] Starting 'browser-sync'...
[18:48:19] Finished 'less' after 212 ms
[Browsersync] Access URLs:
-------------------------------------
Local: localhost:3000
External: 192.168.1.54:3000
-------------------------------------
UI: localhost:3001
UI External: localhost:3001
-------------------------------------
[Browsersync] Serving files from: app
Answer the question
In order to leave comments, you need to log in
as an option, the folder structure does not match and as a result, watch simply refers to non-existent folders
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question