V
V
vasIvas2015-08-19 17:33:36
gulp.js
vasIvas, 2015-08-19 17:33:36

How to combine gulp-newer with gulp-babel?

.pipe(babel(config.babel.settings))
.pipe(newer('./public/javascripts/**/*.js'))
.pipe(jsbeautifier())

.pipe(newer('./public/javascripts/**/*.js'))
.pipe(babel(config.babel.settings))
.pipe(jsbeautifier())

In both the first and second cases, I see how files that have not changed are processed in jsbeautifier.
And it turns out that either newer does not work, or it works, but I do not understand its work, or it is not compatible with preprocessors at all. Which of the options is correct?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-08-19
@vasIvas

.pipe(newer('./public/javascripts/**/*.js'))
here is your problem, you need to specify a directory, not a glob. newer skips files into the pipe whose modification time is greater than the modification time of anything in the directory. Next, newer will try to find the corresponding file in this directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question