I configured the following task to generate a minified file:
gulp.task('frontend-js', function () {
return gulp.src([
'bower_components/jquery/dist/jquery.js',
'bower_components/jquery-ui/jquery-ui.js',
'bower_components/bootstrap/dist/js/bootstrap.js',
'src/AppBundle/Resources/public/Frontend/js/main.js'
])
.pipe(concat('main.min.js'))
.pipe(uglify())
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('web/js'));
});
The above script generates a single minified file.
I want to generate a minified file for each .js
file that exists inside the src/AppBundle/Resources/public/Frontend/js/
folder, except for the main.js
file that was included in the above task.
For example:
src / AppBundle / Resources / public / Frontend / js / test.js = > web / js / teste.min.js src / AppBundle / Resources / public / Frontend / js / teste2.js = > web / js / teste2.min.js src / AppBundle / Resources / public / Frontend / js / teste3.js = > web / js / teste3.min.js
Is it possible to do this with gulp?