daniel
daniel

Reputation: 1235

Backbone templates with Gulp Browserify

Maybe someone figured out how to use .hbs or .html with browserify > backbone > gulp ?

If I skip gulp then ok, in view I require lets say file.hbs then in terminal

browserify -t hbsfy main.js > bundle.js

this command will package up my views with templates, but how to automate it with gulp?

Upvotes: 1

Views: 1061

Answers (1)

daniel
daniel

Reputation: 1235

never mind, found hbs configuration:

gulp.task('js', function() {
   gulp.src('js/app.js')
     .pipe(browserify({
           insertGlobals: true,
           transform: ['hbsfy']
     }))
     .pipe(concat('app.js'))
     .pipe(gulp.dest('./public/js'));
});

Upvotes: 1

Related Questions