I want to process some files with 'coffee', add some js files, concat and minify.
This does not work, coffee fails on the regular js files:
gulp.task 'build-js', ->
gulp.src([
"bower_components/mbdev-core/dist/js/db.js"
"bower_components/mbdev-core/dist/js/utils.js"
"src/js/config/app.coffee"
"src/js/config/app-db.coffee"
"src/js/accounts/accounts.coffee"
"src/js/budget_items/budget_items.coffee"
"src/js/line_items/line_items.coffee"
"src/js/misc/misc.coffee"
"src/js/reports/report_generators.coffee"
"src/js/reports/reports.coffee"
])
.pipe(coffee()).on('error', gutil.log)
.pipe(concat('app.js'))
.pipe(gulp.dest('public/js'))
Is there a way to add files after the coffee part?
You don't need to add files to the original src, but rather to use coffee only "if"...
So, use gulp-if
gulp.task('task', function() {
gulp.src('./stuff/*')
.pipe(gulpif(/[.]coffee$/, coffee()))
.pipe(gulp.dest('./dist/'));
});
See here more about gulp-if.