I need to minimize the number of gulp's command from my gulpfile.
This is my JS folders
js/
templates/
t-01/
t-02/
[...]
t-xxx/
My gulp task for JS (with livereload)
gulp.task('da-js', function() {
gulp.src([
'js/templates/**/*.js',
'!js/templates/**/*.min.js'
])
.pipe(concat('app.min.js'))
.pipe(gulp.dest('js/templates'))
.pipe(livereload());
});
This task is global the destination folder is templates
but I want to detect the current folder of js files like is :
- I'm changing js in
/templates/t-01/
gulp.watch
is launchingapp.min.js
is generating only in this foldert-01
I know the gulp.dest
is not correct to target current folder but I don't know how to do this.
Thank you for your help :)