Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
Gulp 4 - watch task not reloading scss file

I just found some strange problem with my gulp on my Windows 10 machine (on my MacBook Air it works).Below I have my gulpfile and folder structure.

Problem is, that when I save *.html file it detects changes just like supposed to, but *.scss or *.js file not detecting any changes.

Files are completly identical, dependencies are also identical on both systems, simply everything is identical on both systems.

Can someone please help me? I want to work on Win machine now, but as I described, gulp is not detecting any changes in scss or js files.

Thanks in advance

Folder structure

enter image description here

Gulpfile

'use strict';

const { src, series, dest, watch } = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const browserSync = require('browser-sync').create();

// Compile scss into css
function scssTask() {
  return src('./src/scss/**/*.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(dest('./dist/css'))
    .pipe(browserSync.stream());
}

// Watch files for changes
function watchTask() {
  browserSync.init({
    server: {
      baseDir: './',
    },
  });
  watch('src/scss/*.scss', scssTask);
  watch('*.html').on('change', browserSync.reload);
}

exports.default = series(scssTask, watchTask);

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!