Answer the question
In order to leave comments, you need to log in
Help creating a Gulp build?
I would be grateful for the help, since I myself am still a beginner in this matter.
There are the following plugins: browser-sync, gulp-sass, gulp-autoprefixer.
And the following file structure.
let gulp = require('gulp'),
browserSync = require('browser-sync').create(),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer')
gulp.task('sass', function(done) {
gulp.src("src/sass/**/*.sass || scss")
.pipe(sass())
.pipe(gulp.dest("scr/css"))
.pipe(browserSync.stream());
done();
});
gulp.task('serve', function(done) {
browserSync.init({
server: "src/"
});
gulp.watch("scr/sass/**/*.sass || scss", gulp.series('sass'));
gulp.watch("scr/*.html").on('change', () => {
browserSync.reload();
done();
});
done();
});
gulp.task('dist', function(done) {
gulp.src('src/**/*.html, .css, .js')
.pipe(gulp.dest('dist/'))
});
gulp.task('default', gulp.series('sass', 'serve'));
gulp.task('dist', gulp.('dist'));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question