Skip to content

Instantly share code, notes, and snippets.

@innabelaya
Last active August 29, 2015 13:56
Show Gist options
  • Save innabelaya/8915431 to your computer and use it in GitHub Desktop.
Save innabelaya/8915431 to your computer and use it in GitHub Desktop.
/* global MAKE:false */
// process.env.YENV = 'production';
var PATH = require('path');
require('bem-tools-autoprefixer').extendMake(MAKE);
MAKE.decl('Arch', {
blocksLevelsRegexp : /^.+?\.blocks/,
bundlesLevelsRegexp : /^.+?\.bundles$/
});
MAKE.decl('BundleNode', {
getTechs : function() {
return [
'bemjson.js',
'bemdecl.js',
'deps.js',
'bemhtml',
'browser.js+bemhtml',
'stylus',
'css',
'html'
];
},
getForkedTechs : function() {
return this.__base().concat(['browser.js+bemhtml', 'stylus']);
},
getLevelsMap : function() {
return {
desktop : [
'libs/bem-core/common.blocks',
'libs/bem-core/desktop.blocks',
'libs/bem-components/common.blocks',
'libs/bem-components/desktop.blocks',
'libs/bem-components/design/common.blocks',
'libs/bem-components/design/desktop.blocks',
'libs/j/blocks',
'common.blocks',
'desktop.blocks'
]
};
},
getLevels : function() {
var resolve = PATH.resolve.bind(PATH, this.root),
buildLevel = this.getLevelPath().split('.')[0],
levels = this.getLevelsMap()[buildLevel] || [];
return levels
.map(function(path) { return resolve(path); })
.concat(resolve(PATH.dirname(this.getNodePrefix()), 'blocks'));
},
'create-css-node' : function(tech, bundleNode, magicNode) {
var source = this.getBundlePath('stylus');
if(this.ctx.arch.hasNode(source)) {
return this.createAutoprefixerNode(tech, this.ctx.arch.getNode(source), bundleNode, magicNode);
}
}
});
MAKE.decl('AutoprefixerNode', {
getBrowsers : function() {
return [
'last 2 versions',
'ie 10',
'opera 12.16'
];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment