diff --git a/.enb/make.js b/.enb/make.js index 5cb2b8c..3b2ddcd 100644 --- a/.enb/make.js +++ b/.enb/make.js @@ -1,70 +1,38 @@ -var path = require('path'), - PLATFORMS = { - 'common' : ['common'] - }; - module.exports = function(config) { - var platforms = ['common']; - config.includeConfig('enb-bem-tmpl-specs'); - configureSets(platforms, { - tmplSpecs : config.module('enb-bem-tmpl-specs').createConfigurator('tmpl-specs') - }); - - function configureSets(platforms, sets) { - platforms.forEach(function(platform) { - sets.tmplSpecs.configure({ - destPath : platform + '.tmpl-specs', - levels : getSpecLevels(platform), - sourceLevels : getLevels(platform), - coverage : true, - engines : { - bh : { - tech : 'enb-bh/techs/bh-server-include', - options : { - jsAttrName : 'data-bem', - jsAttrScheme : 'json', - sourcemap : true - } - }, - 'bemhtml-dev' : { - tech : 'enb-bemxjst/techs/bemhtml-old', - options : { devMode : true } - }, - 'bemhtml-prod' : { - tech : 'enb-bemxjst/techs/bemhtml-old', - options : { devMode : false } + config.module('enb-bem-tmpl-specs') + .createConfigurator('tmpl-specs') + .configure({ + destPath : 'common.tmpl-specs', + levels : ['common.blocks'], + sourceLevels : [ + { + path : 'libs/bem-core/common.blocks', + check : false + }, + { path : 'common.blocks', check : true } + ], + coverage : { + engines : ['bh'] + }, + engines : { + bh : { + tech : 'enb-bh/techs/bh-server-include', + options : { + jsAttrName : 'data-bem', + jsAttrScheme : 'json', + sourcemap : true } + }, + 'bemhtml-dev' : { + tech : 'enb-bemxjst/techs/bemhtml-old', + options : { devMode : true } + }, + 'bemhtml-prod' : { + tech : 'enb-bemxjst/techs/bemhtml-old', + options : { devMode : false } } - }); + } }); - } }; - -function getLevels(platform) { - var levels = []; - - PLATFORMS[platform].forEach(function(name) { - levels.push({ - path : path.join('libs', 'bem-core', name + '.blocks'), - check : false - }); - }); - - PLATFORMS[platform].forEach(function(name) { - levels.push(name + '.blocks'); - }); - - return levels; -} - -function getSpecLevels(platform) { - var levels = []; - - PLATFORMS[platform].forEach(function(name) { - levels.push(name + '.blocks'); - }); - - return levels; -}