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
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);