0.7.0 • Published 10 years ago

gulp-ember-handlebars v0.7.0

Weekly downloads
546
License
-
Repository
github
Last release
10 years ago

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().

0.7.0

10 years ago

0.6.0

10 years ago

0.5.1

10 years ago

0.5.0

10 years ago

0.4.1

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago