// assets/dom/users.mustache
<div id="users"><p>Here are the {{ users }}</p></div>
Next I pre-compiled the templates using the command line utility Hulk:
hulk assets/dom/* > assets/js/hulks.js
Which gives me a js file with all the compiled templates:
// assets/js/hulks.js
if (!!!templates) var templates = {};
templates["users"] = new Hogan.Template({code: function (c,p,i)...
In my app.js file I do:
// assets/js/app.js
var templates = require('./hulks.js');
Now, the browser gives me a Uncaught ReferenceError: Hogan is not defined error pointing to the new Hogan.Template({... part of the templates file. So obviously I need to require hogan.js too:
// assets/js/app.js
var hogan = require('hogan.js');
var templates = require('./hulks.js');
The problem is that the error remains. What am I doing wrong?
I have some simple templates, this is an example:
Next I pre-compiled the templates using the command line utility Hulk:
Which gives me a js file with all the compiled templates:
In my app.js file I do:
Now, the browser gives me a
Uncaught ReferenceError: Hogan is not defined
error pointing to thenew Hogan.Template({...
part of the templates file. So obviously I need to require hogan.js too:The problem is that the error remains. What am I doing wrong?