Skip to content

GeoSensorWebLab/broccoli-template-builder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Broccoli Template Builder

Build Status

A flexible Broccoli transform plugin for client-side templates.

Install

npm install --save broccoli-template-builder

Example

module.exports = function (broccoli) {
  var compiler = require('ember-template-compiler');
  var broccoliTemplateBuilder = require('broccoli-template-builder');

  var templates = broccoli.makeTree('your/templates');

  templates = broccoliTemplateBuilder(templates, {
    extensions: ['hbs']               // required
  , outputFile: 'assets/templates.js' // required
  , namespace: 'Ember.TEMPLATES'      // optional (defaults to 'JST')
  , compile: function (string) {      // optional (defaults to using plain template string)
      return 'Ember.Handlebars.template('+compiler.precompile(string)+')';
    }
  });

  return templates;
};

About

Compile client-side templates into 1 JavaScript file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.6%
  • HTML 1.4%