browserify-underscore-templatify

0.1.0 • Public • Published

browserify-underscore-templatify

Plugin for browserify to turn required html files into underscore templates.

Require html files directly from your javascript and use them as compiled templates.

In your browserify bundling code:

browserify = require("browserify");
templatify = require("browserify-underscore-templatify");
bundler = new browserify();
bundler.transform(templatify());
bundler.bundle();

And then in your application:

view = require("index.html");
return view(); //renders the view

options

You can pass in an optional object defining the file extensions to look for when deciding if a file is a template or not:

templatify({ext:['.us-templ']}); //default is ['.html']

Package Sidebar

Install

npm i browserify-underscore-templatify

Weekly Downloads

3

Version

0.1.0

License

none

Last publish

Collaborators

  • digijin