gruntjs / grunt-contrib-handlebars

Precompile Handlebars templates to JST file.
http://gruntjs.com/
MIT License
282 stars 126 forks source link

Automatically including runtime #57

Closed Fauntleroy closed 11 years ago

Fauntleroy commented 11 years ago

I'd like to add the ability to automatically prepend the Handlebars runtime to the compiled js file.

Right now, I'm doing this:

...
concat: {
    experiment: {
        files: {
            'assets/compiled/templates.js': ['node_modules/grunt-contrib-handlebars/node_modules/handlebars/dist/handlebars.runtime.js','assets/compiled/templates.js']
        }
    }
},

How about an option called runtime that accepts a boolean and is false by default?

tkellen commented 11 years ago

Sorry, but I don't want to bundle a specific version of the runtime. You'll need to write to a temporary file and use grunt-contrib-concat to bring it in.

Fauntleroy commented 11 years ago

Technically, isn't a specific version of Handlebars already being used to compile the templates? Isn't it weirder to manually choose a runtime to use client side? Besides, this would be completely optional, and off by default.

tkellen commented 11 years ago

No, we've specified a tilde version range which will automatically receive updates for patch releases. The handlebars project has broken backwards compatibility in the runtime with patch releases in the past--I don't want to absorb the issues that will result if it happens again.