Reputation: 49873
I want to iterate over all the src files and move every file in a folder named with the file name itself, for example.
from:
hello.js
omg.js
to:
hello/
hello.js
omg/
omg.js
I have this task:
gulp.src('/*.js')
.pipe(gulp.dest('/' + filename here.......));
How do i achieve this?
Upvotes: 1
Views: 2277
Reputation: 1581
gulp.task('pack', function () {
return gulp.src('temp/**/*.js')
.pipe(uglify())
.pipe(rename(function (path) {
path.dirname += "/"+path.basename;
path.extname = ".min.js";
}))
.pipe(gulp.dest('./build'));
});
Upvotes: 3