I have a folder with many subfolders and these subfolder have many subfolders. Is there a way to transform all the ES6 files into ES5 with a command from the root?
The approach I have is:
var gulp = require('gulp');
var babel = require('gulp-babel');
gulp.task('transform', function () {
return gulp.src('folder/**/**/**/**/**/*.js')
.pipe(babel())
.pipe(gulp.dest('folder/compiled'));
});
gulp.task('watch', function() {
gulp.watch('folder/**/**/**/**/**/*.js', ['transform'])
});
gulp.task('default', ['watch']);