Gulp plugin to preload HTML in batman.js, a la davemo/grunt-batman-templates
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
index.js
package.json
readme.md

readme.md

gulp-batman-templates

This is gulp port of davemo/grunt-batman-templates. Bravo to him for thinking this up.

Install

npm install gulp-batman-templates

Example

Lets say you have some .jade files that you want to preload in your batman.js app:

var gulp = require('gulp');
var concat = require('gulp-concat');
var jade = require('gulp-jade');
var batmanTemplates = require("gulp-batman-templates")

gulp.task("html", function(){
  gulp.src(["./public/batman/html/**/*.jade"])  // Load the .jade files
    .pipe(jade())                               // Convert to HTML
    .pipe(batmanTemplates())                    // Convert HTML to JavaScript for Batman.HTMLStore
    .pipe(concat('templates.js'))               // Join all into one file
    .pipe(gulp.dest("./public/batman/build/"))  // Spit that file out!
})

Now, make sure templates.js is included in your app:

  <script src='/path/to/batman.js'></script>
  <script src='/path/to/my_app.js'></script>
  <script src='/path/to/templates.js'></script>

You're done!