|
1 | | -var path = require('path'), |
2 | | - PLATFORMS = { |
3 | | - 'common' : ['common'] |
4 | | - }; |
5 | | - |
6 | 1 | module.exports = function(config) { |
7 | | - var platforms = ['common']; |
8 | | - |
9 | 2 | config.includeConfig('enb-bem-tmpl-specs'); |
10 | 3 |
|
11 | | - configureSets(platforms, { |
12 | | - tmplSpecs : config.module('enb-bem-tmpl-specs').createConfigurator('tmpl-specs') |
13 | | - }); |
14 | | - |
15 | | - function configureSets(platforms, sets) { |
16 | | - platforms.forEach(function(platform) { |
17 | | - sets.tmplSpecs.configure({ |
18 | | - destPath : platform + '.tmpl-specs', |
19 | | - levels : getSpecLevels(platform), |
20 | | - sourceLevels : getLevels(platform), |
21 | | - coverage : true, |
22 | | - engines : { |
23 | | - bh : { |
24 | | - tech : 'enb-bh/techs/bh-server-include', |
25 | | - options : { |
26 | | - jsAttrName : 'data-bem', |
27 | | - jsAttrScheme : 'json', |
28 | | - sourcemap : true |
29 | | - } |
30 | | - }, |
31 | | - 'bemhtml-dev' : { |
32 | | - tech : 'enb-bemxjst/techs/bemhtml-old', |
33 | | - options : { devMode : true } |
34 | | - }, |
35 | | - 'bemhtml-prod' : { |
36 | | - tech : 'enb-bemxjst/techs/bemhtml-old', |
37 | | - options : { devMode : false } |
| 4 | + config.module('enb-bem-tmpl-specs') |
| 5 | + .createConfigurator('tmpl-specs') |
| 6 | + .configure({ |
| 7 | + destPath : 'common.tmpl-specs', |
| 8 | + levels : ['common.blocks'], |
| 9 | + sourceLevels : [ |
| 10 | + { |
| 11 | + path : 'libs/bem-core/common.blocks', |
| 12 | + check : false |
| 13 | + }, |
| 14 | + { path : 'common.blocks', check : true } |
| 15 | + ], |
| 16 | + coverage : { |
| 17 | + engines : ['bh'] |
| 18 | + }, |
| 19 | + engines : { |
| 20 | + bh : { |
| 21 | + tech : 'enb-bh/techs/bh-server-include', |
| 22 | + options : { |
| 23 | + jsAttrName : 'data-bem', |
| 24 | + jsAttrScheme : 'json', |
| 25 | + sourcemap : true |
38 | 26 | } |
| 27 | + }, |
| 28 | + 'bemhtml-dev' : { |
| 29 | + tech : 'enb-bemxjst/techs/bemhtml-old', |
| 30 | + options : { devMode : true } |
| 31 | + }, |
| 32 | + 'bemhtml-prod' : { |
| 33 | + tech : 'enb-bemxjst/techs/bemhtml-old', |
| 34 | + options : { devMode : false } |
39 | 35 | } |
40 | | - }); |
| 36 | + } |
41 | 37 | }); |
42 | | - } |
43 | 38 | }; |
44 | | - |
45 | | -function getLevels(platform) { |
46 | | - var levels = []; |
47 | | - |
48 | | - PLATFORMS[platform].forEach(function(name) { |
49 | | - levels.push({ |
50 | | - path : path.join('libs', 'bem-core', name + '.blocks'), |
51 | | - check : false |
52 | | - }); |
53 | | - }); |
54 | | - |
55 | | - PLATFORMS[platform].forEach(function(name) { |
56 | | - levels.push(name + '.blocks'); |
57 | | - }); |
58 | | - |
59 | | - return levels; |
60 | | -} |
61 | | - |
62 | | -function getSpecLevels(platform) { |
63 | | - var levels = []; |
64 | | - |
65 | | - PLATFORMS[platform].forEach(function(name) { |
66 | | - levels.push(name + '.blocks'); |
67 | | - }); |
68 | | - |
69 | | - return levels; |
70 | | -} |
0 commit comments