Wray Bowling
Wray Bowling

Reputation: 2506

Can I use .handlebars files with Meteor?

For the sake of clarity, and because SublimeText isn't bright enough to know the difference between lots of different flavors of ".html", I thought about using .handlebars as the extension to my handlebars-templated files. Meteor seems to only accept files with with .html extension, and I'm wondering if there's a way I can get it to accept .handlebars files too. Thanks

Upvotes: 2

Views: 123

Answers (2)

Wray Bowling
Wray Bowling

Reputation: 2506

The comment left by Hubert OG was the simplest solution. Use .handlebars.html files. The SublimeText plugin for handlebars now recognizes that file extension too.

Upvotes: 1

Christian Fritz
Christian Fritz

Reputation: 21364

This may be more complicated than you'd like, but one way you can accomplish this is by making your own version of the templating package.

  1. make a copy of the subtree,
  2. rename the package,
  3. edit plugin/compile-templates.js and at the bottom in the call to registerSourceHandler, replace "html" with "handlebars".
  4. put your new package into your project's packages and add it using meteor add yourpackagename.

Upvotes: 1

Related Questions