0

I have problem. Yestrday I had to update the Node.js kernel and now that I change something in the LESS file, there will be no css update. Gulpfile is the same as before the update. Could someone advise me what's wrong with my gulpfile script?

The HTML file update is OK.

//*********** IMPORTS *****************
var gulp = require('gulp'),
browserSync = require('browser-sync');
var postcss = require('gulp-postcss');
var less = require('gulp-less');
var watch = require('gulp-watch');
var livereload = require('gulp-livereload');
var autoprefixer = require('gulp-autoprefixer');
var concat = require('gulp-concat-css');
var cssmin = require('gulp-cssmin');


/* BROWSERSYNC */
gulp.task('browserSync', function () {
    var files = ['orient-spa/**'];

    browserSync.init(files, {
       server: {
          baseDir: 'orient-spa/',
          index: 'index.html'
       },
       logPrefix: 'OS01', 
       browser: ['chrome']
    });
});

gulp.task('css', function () {
    var processors = [
        autoprefixer
    ];
    return gulp.src('./orient-spa/skins/less/index-files.less')
    .pipe(less())
    .pipe(postcss(processors))
    .pipe(gulp.dest('./orient-spa/skins/css/'))
    .pipe(livereload());
});

gulp.task('watch', function() {
    livereload.listen();
    gulp.watch('./orient-spa/skins/less/*.less', ['css']);
    gulp.watch('./orient-spa/skins/css/*.css', ['concatMinify']);
});

gulp.task('concatMinify', function () {
    return gulp.src('./orient-spa/skins/css/*.css')
    .pipe(concat("index.css"))
    .pipe(cssmin())
    .pipe(gulp.dest('./orient-spa/skins/css/compiled'))
    .pipe(livereload());
});

gulp.task('default', ['browserSync', 'watch', 'css', 'concatMinify']);

Thanks for your advice :-)

ondra15
  • 143
  • 4
  • 16
  • If it is really related to your update, i cannot help but you may want to replace `gulp.watch('./orient-spa/skins/less/*.less', ['css']);` with `gulp.watch('./orient-spa/skins/less/**/*.less', ['css']);` to also watch file within subfolders. Also have you already reload your gulp watch command since the upgrade ? – rebrec Mar 18 '18 at 17:39
  • please provide the version you were using and the new version you are using too – rebrec Mar 18 '18 at 17:39

1 Answers1

0

I try this path, but problem remains.

Last version node.js was Node.js 7.2.1 (Node.js), now Node.js 9.8.0.

I attach an image to the console after changing 1 line in the LESS file.screen from CMD console

Here I see that the set of commands does not call correctly. Or they are called repeatedly. Do not you see a mistake here, please?

Thanks for your advice

ondra15
  • 143
  • 4
  • 16