Home

Awesome

ember-templates-loader

Load templates into Ember with webpack.

Description

This will precompile your HTMLBars templates when you build with webpack with overrides specific for Ember.

Usage

var MyView = Ember.View.extend({
  template: require('ember-templates!./templates/my-view.hbs')
});

Or better within your webpack.config.js:

module.exports = {
  module: {
    loaders: [
      { test: /\.hbs$/, loader: 'ember-templates' }
    ]
  },
  emberTemplatesLoader: {
    // Where to require the compiler from, defaults to an internal compiler.
    compiler: 'ember/ember-template-compiler',
    // OR: Pass in the precompiler directly...
    // precompile: require('ember/ember-template-compiler').precompile,
  }
};

Now all required handlebars templates will be compiled for Ember first.

Install

npm install ember-templates-loader --save-dev

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style.

Release History

License

Copyright (c) 2017 Kyle Robinson Young
Licensed under the MIT license.