I have a structure like
- wwwroot/lib/site/scripts
- wwwroot/lib/site/scripts/modules
- wwwroot/lib/site/scripts/stuff
They all contain different js-files, I'd like to uglify them and output them to the same directory
The script below will only output them to
- wwwroot/scripts
- wwwroot/scripts/modules
- wwwroot/scripts/stuff
I'd like to have them all in wwwroot/scripts, I do not wish to concat any files.
gulp.task('site-js', function () {
var files = [
'wwwroot/lib/site/scripts/**/*.js'
];
return gulp.src(files)
.pipe(uglify())
.pipe(gulp.dest('wwwroot/scripts/'));
});
Sounds like
gulp-rename
is what you're looking for: