Fixes #50 Initialize the loader after the runtime is fully initialized

This commit is contained in:
Patrick Steele-Idem 2015-03-19 15:22:38 -06:00
parent b575c6bd4f
commit e3e2a26834

View File

@ -30,11 +30,7 @@ var asyncWriter = require('async-writer');
// that are available in every template (empty, notEmpty, etc.)
var helpers = require('./helpers');
// The loader is used to load templates that have not already been
// loaded and cached. On the server, the loader will use
// the compiler to compile the template and then load the generated
// module file using the Node.js module loader
var loader = require('./loader');
var loader;
// If the optional "stream" module is available
// then Readable will be a readable stream
@ -69,7 +65,7 @@ Template.prototype = {
if (data.$global) {
out.global = extend(out.global, data.$global);
delete data.$global;
delete data.$global;
}
this._(data, out);
@ -246,3 +242,9 @@ exports.createWriter = function(writer) {
exports.helpers = helpers;
exports.Template = Template;
// The loader is used to load templates that have not already been
// loaded and cached. On the server, the loader will use
// the compiler to compile the template and then load the generated
// module file using the Node.js module loader
loader = require('./loader');