0
I set 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 file .js
that exists inside the folder src/AppBundle/Resources/public/Frontend/js/
, except the file main.js
which was included in the above task.
For example:
src/Appbundle/Resources/public/Frontend/js/teste.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
It is possible to do this with Gulp?