How to use the bem-xjst.bemtree function in bem-xjst

To help you get started, we’ve selected a few bem-xjst examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bem / bem-xjst / .enb / techs / bemxjst.js View on Github external
var xjst = require('bem-xjst');
var bemhtml = xjst.bemhtml.generate('', { exportName: 'BEMHTML' });
var bemtree = xjst.bemtree.generate('', { exportName: 'BEMTREE' });

module.exports = require('enb/lib/build-flow').create()
    .name('bemxjst')
    .target('target', '?.bemxjst.js')
    .builder(function() {
        return bemhtml
            //.replace('api.exportApply(exports);', '')
            .replace('if (typeof modules === "object") {', 'if (false && typeof modules === "object") {')
            .replace('BEMHTML = buildBemXjst(_libs)', 'BEMHTML = buildBemXjst')
            .replace('BEMHTML= buildBemXjst(glob)', 'BEMHTML = buildBemXjst')
            .concat(bemtree)
            //.replace('api.exportApply(exports);', '')
            .replace('if (typeof modules === "object") {', 'if (false && typeof modules === "object") {')
            .replace('BEMTREE = buildBemXjst(_libs)', 'BEMTREE = buildBemXjst')
            .replace('BEMTREE= buildBemXjst(glob)', 'BEMTREE = buildBemXjst')
            .concat(require('./i18n'));

bem-xjst

Declarative Template Engine for the browser and server

MPL-2.0
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis