It is necessary that when you change in gulpfile.js (namely, when you add a new script file), the task was started where the files were newly coded and compressed to 1. I tried to look at the change of gulpfile but for some reason it did not help

gulp.watch('gulpfile.js',['scripts'] ); 

Here is the gulpfile.js code

 var gulp = require('gulp'), concat = require('gulp-concat'), uglify = require('gulp-uglifyjs'); gulp.task('scripts', function () { return gulp.src([ 'app/js/libs/plugin.js', 'app/js/common.js' ]) .pipe(concat('main.min.js')) .pipe(uglify()) .pipe(gulp.dest('dist/js')); }); gulp.task('watch', function () { gulp.watch('gulpfile.js',['scripts'] ); gulp.watch('app/js/**/*.js',['scripts'] ); }); gulp.task('default', ['scripts', 'watch']); 

    1 answer 1

    And it does not help, you offer a galp to follow yourself. It is necessary that someone else, who would restart the galp. Use nodemon , run it so that it runs gulp and it follows gulpfile.js

     nodemon -w gulpfile.js gulp 
    • I will try, just in grunt, I followed the changes of the gruntfile itself, and there if I added new js files, then he recompiled js, thought and then did so. - Karalahti