Skip to content

Version 4.0.0 does not reflect less file changes when using gulp-watch #283

@parapada73

Description

@parapada73

I am using gulp-watch (5.0.0).
After updating to 4.0.0 today, CSS is generated but the changes are not reflected.
Version 3.5.0 did not have this problem.

Below is the code that uses gulp-watch.

const gulp = require('gulp');
const gulp_watch = require('gulp-watch');
const gulp_messenger = require('gulp-messenger');
const gulp_plumber = require('gulp-plumber');
const gulp_less = require('gulp-less');
const path = require('path');
const beep = require('beepbeep');
const gulp_messenger = require('gulp-messenger');

const gulp_watch_options = {
	useFsEvents: true,
};

let showSuccessMessage = function(pathString){
	pathString = path.resolve(pathString);
	gulp_messenger.success('<%= name %> : maked', {name: pathString});
};

let makeCSS = function(){
	let isError = false;
	
	const sourcePath = path.join(basePath_webroot, 'WEB-INF/_ui-src/responsive/themes/fn/less/style.less');
	const basePath_target = path.join(basePath_webroot, '_ui/responsive/theme-fn/css');
	
	return gulp.src(sourcePath)
		.pipe(gulp_plumber({errorHandler: function(err){
			beep();
			gulp_messenger.error(err);
			isError = true;
			this.emit('end');
		}}))
		.pipe(gulp_less())
		.pipe(gulp.dest('.', {cwd:basePath_target}))
		.on('end', function(){
			if(!isError){
				showSuccessMessage(path.join(basePath_target, 'style.css'));
			}
			
			isError = false;
		});
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions