Skip to content

vinay3206/gulp-ember-handlebars

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-ember-handlebars NPM version Build status

Ember Handlebars plugin for gulp 3.

Deprecation Notice

This plugin is no longer maintained. You should consider replacing your usage with gulp-handlebars. Starting with gulp-handlebars 2.2.0, embers-handlebars is supported.

Usage

First, install gulp-ember-handlebars as a development dependency:

npm install --save-dev gulp-ember-handlebars

Then, use the plugin in your gulpfile.js:

var handlebars = require('gulp-ember-handlebars');

gulp.task('templates', function(){
  gulp.src(['app/templates/*.hbs'])
    .pipe(handlebars({
      outputType: 'amd'
     }))
    .pipe(concat('templates.js'))
    .pipe(gulp.dest('build/js/'));
});

API

options.outputType

Type: String Default: amd

The desired output type. One of the following:

  • browser - Produce plain JavaScript files for the browser.
  • amd - Produce AMD modules.
  • cjs - Produce CommonJS modules.

options.templateRoot

Type: String Default: templates

This option specifies the name of the root directory for template files.

options.namespace

Type: String Default: Ember.TEMPLATES

This option is only necessary when options.outputType is browser. This option's value is the namespace that is assigned the pre-compiled templates. Use dot notation (e.g. 'Ember.Templates`) for nested namespaces.

options.processName

Type: Function Default: Strip file extension

This option accepts a function which takes one argument (the template name) and returns a string which will be used as the key for the precompiled template object. By default, the filename minus the extension is used.

options.compilerOptions

Type: Object

Compiler options to pass to Ember.Handlebars.precompile().

About

Ember Handlebars plugin for gulp

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%