Answer the question
In order to leave comments, you need to log in
Running Gulp task?
I can’t figure out how to update index.min.js
when changes are made in script.js
, but do not touch those files in which there were no changes. There is a task
gulp.task('scripts', function(){
return gulp.src([
'src/assets/libs/jquery/dist/jquery.min.js',
'src/assets/js/script.js'
])
.pipe(concat('index.min.js'))
.pipe(uglify())
.pipe(gulp.dest('src/assets/js'));
});
gulp.task('watch', function() {
gulp.watch('src/assets/css/**/*.*', gulp.series('styles')).on('unlink',
function(filepath) {
remember.forget('styles', path.resolve(filepath));
});
gulp.watch('src/**/*.*', gulp.series('assets'));
});
gulp.task('watch', function() {
gulp.watch('src/assets/css/**/*.*', gulp.series('styles')).on('unlink',
function(filepath) {
remember.forget('styles', path.resolve(filepath));
});
gulp.watch('src/assets/js/**/*.*', gulp.series('scripts')).on('unlink',
function(filepath) {
remember.forget('scripts', path.resolve(filepath));
});
gulp.watch('src/**/*.*', gulp.series('assets'));
});
Второй
the browser is restarted and the task scripts
andassets
gulp.task('assets', function() {
return gulp.src(['src/**'], {since: gulp.lastRun('assets')})
.pipe(newer('dist'))
.pipe(gulp.dest('dist'));
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question