|
|
@@ -1,5 +1,6 @@
|
|
|
import { parse } from './parser/index'
|
|
|
import { generate } from './codegen/index'
|
|
|
+import { directives } from './codegen/directives/index'
|
|
|
|
|
|
const cache1 = Object.create(null)
|
|
|
const cache2 = Object.create(null)
|
|
|
@@ -10,3 +11,7 @@ export function compile (html, preserveWhitespace) {
|
|
|
const hit = cache[html]
|
|
|
return hit || (cache[html] = generate(parse(html, preserveWhitespace)))
|
|
|
}
|
|
|
+
|
|
|
+export function registerDirective (name, fn) {
|
|
|
+ directives[name] = fn
|
|
|
+}
|