Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

component-builder-handlebars Build Status

Builder2.js plugin to precompile Handlebars templates to Component.js modules.

Install

With npm do:

$ npm install component-builder-handlebars --save-dev

Usage

Build

var builder = require('component-builder');
var hbs = require('component-builder-handlebars');

var options = {
  extname: 'hbs',
  partialRegex: /^_/
};

builder.scripts(tree)
  .use('scripts', Builder.plugins.js())
  .use('templates', hbs(options))
  .end(function(err, string) {
    fs.writeFileSync(dest, string);
  });

Partials

To include a partial inside a template:

{{> componentName/path/to/_partial }}

For instance.

Options

extname

Type: String
Default value: .hbs
Define the Handlebars extension name.

partialRegex

Inspired from grunt-contrib-handlebars
Type: RegExp
Default value: /^_/
Define the prefix to identify Handlebars partials.

Example

See example folder.

To build it:

$ npm run example

License

Licensed under the MIT license.

About

builder2.js plugin to precompile Handlebars templates.

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.