gulp-batman-templates

0.0.1 • Public • Published

gulp-batman-templates

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

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("./public/batman/gulp-batman-templates")

gulp.task("html", function(){
  gulp.src(["./public/batman/html/**/*.jade"])  // Load the .jade files
    .pipe(jade())                               // Convert to HTML and
    .pipe(batmanTemplates())                    // Convert 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!

Package Sidebar

Install

npm i gulp-batman-templates

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • rmosolgo