Answer the question
In order to leave comments, you need to log in
How to fix this galp build?
I'm trying to write the correct gulpfile, but I can't write cannot get in the browser.
Gulp 4.0.2
All packages via npma added as DevDependency
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
gulp.task('sass', function(done) {
gulp.src("assets/css/scss/*.scss")
.pipe(sass())
.pipe(gulp.dest("assets/css/css"))
.pipe(browserSync.stream());
done();
});
gulp.task('serve', function(done) {
browserSync.init({
server: "homepage.html"
});
gulp.watch("src/sass/*.sass", gulp.series('sass'));
gulp.watch("src/*.html").on('change', () => {
browserSync.reload();
done();
});
done();
});
gulp.task('default', gulp.series('sass', 'serve'));
Answer the question
In order to leave comments, you need to log in
you can go and read the browserSync documentation.
Specify a folder with html files for the server, and allow it to show a directory listing.
https://browsersync.io/docs/options#option-server
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question