How to update files in Gulp?

Trying to make a bundle with Tasca js
gulp.task('js', () => {
 return gulp.src('dev/src/**/*.js')
 // .pipe(file('bundle.wheelly.js', 'dev/dist'))

But this is not an option because this script is "disposable", i.e., when I save the files in the directory dev/src/**/*.js task js is run again and the file bundle.js besides the code that was added to the new code.
But I want to delete (refresh) the old code and take new of directories dev/src/**/*.js.
I tried to link the plugin gulp-file and gulp-concat, but it did not, the plugin can't work or I don't know how to get them to work together.
How to solve the problem?
June 10th 19 at 15:54
2 answers
June 10th 19 at 15:56
Use the plugin gulp-clean, and do the task, something like:
gulp.task('clean', function() {
 return gulp.src(['build'], {read: false})

And call this task before all other
Works, thank you!) Now it remains to understand why there are exports/imports in babel - harmon.Koelpin commented on June 10th 19 at 15:59
Recommend to take ready-made boilerplate and finished them for yourself (example)
Or here - dean.Stoltenberg65 commented on June 10th 19 at 16:02
June 10th 19 at 15:58
To use incremental Assembly.
watch in the help - documentation.

So I advise you to watch the screencast Ilya Cantor - link
Of course I use the watch, but may be primitive. Thanks for the tip! But to screencast I. Cantor still could not crawl, all set aside for later) - harmon.Koelpin commented on June 10th 19 at 16:01
Very vain, start looking, most of the questions will fall off by itself.

Here satisfied with a simple solution of such tasks:

gulp.task('build:js', function () {
 return gulp.src(['source/js/*.js',

$.watch(['source/js/**/*.js'], function(event, cb) {
 return runSequence('build:js', reload);
- dean.Stoltenberg65 commented on June 10th 19 at 16:04
hmm I wonder what I need is probably hidden behind the key word reload) - harmon.Koelpin commented on June 10th 19 at 16:07
var reload = browserSync.reload;

I don't think it's a reboot of the tab browser, to the Assembly of the js is irrelevant. - Marshall67 commented on June 10th 19 at 16:10
AA, I thought that watch is the key word reload. Suggested without looking at documentation) - harmon.Koelpin commented on June 10th 19 at 16:13

Find more questions by tags Gulp.jsJavaScript