How to use precompiled templates in Handlebars with RequireJS?
问题 I'd like to precompile my Handlebars templates, but I'm not sure how this works in development mode. Is it common practice have some background process like Guard running to constantly monitor changes to Handlebars template files? I'm using RequireJS to pull in templates; e.g.: define(['jquery', 'handlebars', 'text!templates/my_template'], function($, Handlebars, myTemplate) { // ... var data = {"some": "data", "some_more": "data"}; var templateFn = Handlebars.compile(myTemplate); $('#target'