Answer the question
In order to leave comments, you need to log in
How to specify the same path in gulp-newer as the file from src?
I'm trying to make a task that checks if the file with the extension has been .source.js
changed, and if so, then we minimize it, change the extension to .js
and put it in the same folder as the source. .source.js
It turns out two files: script.source.js and the minified script.js
gulp.task('minify', () => {
return gulp.src('../js/**/*.source.js', {since: gulp.lastRun('minify')})
.pipe(newer()) // как сюда прописать dest файла?
.pipe(uglify())
.pipe(extension('.js', '.source.js'))
.pipe(gulp.dest((file) => {
return file.base;
}));
});
gulp.task('minify', () => {
return gulp.src('../js/**/*.source.js', {since: gulp.lastRun('minify')})
.pipe(newer('../js/'))
.pipe(uglify())
.pipe(extension('.js', '.source.js'))
.pipe(gulp.dest('../js/'));
});
options.ext
.pipe(newer('../js/', {ext: '.js'}))
, then one hell of a change is not visible ...
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