gabrielgrant / node-ember-precompile

Precompile Handlebars templates for Ember.js
53 stars 25 forks source link

Support Ember's new Router api: Added basePath / -b option which is used to calculate the relative path which is then added to the template name #4

Closed ralfschimmel closed 11 years ago

ralfschimmel commented 11 years ago

The new router api from Ember is expecting template names which have a complete path, when using nested routes. This requires template names like 'website/users/user' instead of 'user' which is currently the templateName when such a template is precompiled.

This pull request enables a -b option which refers to the path which is stripped from the full-path of the template which is being compiled. The template name is then built from the stripped path + the filename itself (without the .handlebars).

bradfol commented 11 years ago

+1 for this. Needed when using routes nested in resources.

gabrielgrant commented 11 years ago

Hey folks, sorry for leaving this sitting for so long. This and https://github.com/gabrielgrant/node-ember-precompile/pull/3 look to be different approaches to solving the same problem. Any opinion on which is preferable? cc: @Nthalk

ralfschimmel commented 11 years ago

I switched to using grunt with grunt-ember-templates.