An ENB tech which compiles BH and BEMXJST templates to the javascript BEM module definitions.
Description
This tech takes provided BH, BEMHTML or BEMTREE template files, and converts it to the ES2015 javascript code. Export name for templates and type must be specified in the required options exportName and type accordingly.
For example, we have next template files:
BH
bh.match('block',(ctx)=>{
ctx.tag('h1');
ctx.content({
elem:'hello-text',
message:ctx.message
})
})
BEMHTML
block('block').elem('hello-text')(
tag()('strong'),
content((ctx)=>{
returnctx.message
})
)
BEMTREE
block('block')(
extend()({
'ctx.msg':'Hello world!!!'
})
)
This files will be compiled to the templates files contained the next code: