add __compile helper
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
import * as plugins from './smarthbs.plugins'
|
||||
export type TTemplateStringType = 'filePath' | 'code'
|
||||
|
||||
export let handlebars = plugins.handlebars
|
||||
export * from './smarthbs.compile'
|
||||
export * from './smarthbs.helpers'
|
||||
import './smarthbs.helpers'
|
||||
export * from './smarthbs.partials'
|
||||
export * from './smarthbs.template'
|
||||
|
@ -1,4 +1,7 @@
|
||||
import * as plugins from './smarthbs.plugins'
|
||||
|
||||
export let registerHelper = plugins.handlebars.registerHelper
|
||||
plugins.handlebars.registerHelper('__compile', (evaluationString, evaluationContext) => {
|
||||
let template = plugins.handlebars.compile(evaluationString)
|
||||
return template(evaluationContext)
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user