Answer the question
In order to leave comments, you need to log in
Why is gulp shutting down after 20-30 seconds?
After I added browser-sync to the assembly, the gallp began to cut down after 20-30 seconds. Why is this happening and how to fix it?
const GulpClient = require('gulp');
const { src, dest, watch, parallel } = require('gulp');
const scss = require('gulp-sass')(require('sass'));
const concat = require('gulp-concat');
const browserSync = require('browser-sync').create();
function browsersync() {
browserSync.init({
server: {
baseDir: 'app/'
}
});
};
function styles() {
return src('app/scss/style.scss')
.pipe(scss({outputStyle: 'compressed'}))
.pipe(concat('style.min.css'))
.pipe(dest('app/css'))
.pipe(browserSync.stream());
};
function watching() {
watch(['app/scss/**/*.scss'], styles)
watch(['app/*.html']).on('change', browserSync.reload);
};
exports.default = parallel(browsersync, watching);
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