2014-01-15 19:02:37 +01:00
|
|
|
/*globals Handlebars: true */
|
|
|
|
import Handlebars from "./handlebars.runtime";
|
2013-02-16 11:01:51 +01:00
|
|
|
|
2014-01-15 19:02:37 +01:00
|
|
|
// Compiler imports
|
|
|
|
import AST from "./handlebars/compiler/ast";
|
|
|
|
import { parser as Parser, parse } from "./handlebars/compiler/base";
|
|
|
|
import { Compiler, compile, precompile } from "./handlebars/compiler/compiler";
|
|
|
|
import JavaScriptCompiler from "./handlebars/compiler/javascript-compiler";
|
2013-02-16 11:01:51 +01:00
|
|
|
|
2014-01-15 19:02:37 +01:00
|
|
|
var _create = Handlebars.create;
|
2013-02-16 11:01:51 +01:00
|
|
|
var create = function() {
|
2014-01-15 19:02:37 +01:00
|
|
|
var hb = _create();
|
2013-02-16 11:01:51 +01:00
|
|
|
|
2014-01-15 19:02:37 +01:00
|
|
|
hb.compile = function(input, options) {
|
|
|
|
return compile(input, options, hb);
|
|
|
|
};
|
|
|
|
hb.precompile = function (input, options) {
|
|
|
|
return precompile(input, options, hb);
|
|
|
|
};
|
|
|
|
|
|
|
|
hb.AST = AST;
|
|
|
|
hb.Compiler = Compiler;
|
|
|
|
hb.JavaScriptCompiler = JavaScriptCompiler;
|
|
|
|
hb.Parser = Parser;
|
|
|
|
hb.parse = parse;
|
2013-02-16 11:01:51 +01:00
|
|
|
|
|
|
|
return hb;
|
|
|
|
};
|
|
|
|
|
2014-01-15 19:02:37 +01:00
|
|
|
Handlebars = create();
|
2013-02-16 11:01:51 +01:00
|
|
|
Handlebars.create = create;
|
|
|
|
|
2014-01-15 19:02:37 +01:00
|
|
|
export default Handlebars;
|