Skip to content

Commit 5f6e83d

Browse files
committed
ENB config: was simplified
1 parent d80d06f commit 5f6e83d

File tree

1 file changed

+31
-63
lines changed

1 file changed

+31
-63
lines changed

.enb/make.js

Lines changed: 31 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,38 @@
1-
var path = require('path'),
2-
PLATFORMS = {
3-
'common' : ['common']
4-
};
5-
61
module.exports = function(config) {
7-
var platforms = ['common'];
8-
92
config.includeConfig('enb-bem-tmpl-specs');
103

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
3826
}
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 }
3935
}
40-
});
36+
}
4137
});
42-
}
4338
};
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

Comments
 (0)