Skip to content
This repository has been archived by the owner on Jan 13, 2018. It is now read-only.

Commit

Permalink
Sync with bem:custom-bundle-source
Browse files Browse the repository at this point in the history
  • Loading branch information
eprev committed Feb 19, 2013
1 parent d757655 commit ebe9784
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/nodes/level.js
Expand Up @@ -48,10 +48,6 @@ registry.decl(LevelNodeName, MagicNode, {

},

getSourceTechs: function() {
return ['bemjson.js', 'bemdecl.js'];
},

alterArch: function() {

var ctx = this.ctx;
Expand Down Expand Up @@ -208,6 +204,10 @@ registry.decl(BundlesLevelNodeName, LevelNodeName, {
return false;
},

getBundleSourceTechs: function() {
return ['bemjson.js', 'bemdecl.js'];
},

/**
* Overriden.
*
Expand Down Expand Up @@ -262,8 +262,6 @@ registry.decl(BundlesLevelNodeName, LevelNodeName, {
*/
scanLevelItems: function() {

var sourceTechs = this.getSourceTechs();

return _.uniq(
_.sortBy(
this.level.getItemsByIntrospection()
Expand All @@ -274,8 +272,8 @@ registry.decl(BundlesLevelNodeName, LevelNodeName, {
// filter out merged bundle, it will be configured later
if (type === 'block' && item.block === this.mergedBundleName()) return false;

// build only blocks and elems that have file in source techs
return ~['block', 'elem'].indexOf(type) && ~sourceTechs.indexOf(item.tech);
// build only blocks and elems that have file in `bundleSourceTechs` techs
return ~['block', 'elem'].indexOf(type) && ~this.getBundleSourceTechs.indexOf(item.tech);

}, this),
U.bemKey),
Expand Down

0 comments on commit ebe9784

Please sign in to comment.