Advertisement
Guest User

make.js

a guest
Jun 14th, 2015
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* global MAKE:false */
  2.  
  3. // process.env.YENV = 'production';
  4.  
  5. var PATH = require('path');
  6.  
  7. require('bem-tools-autoprefixer').extendMake(MAKE);
  8.  
  9. MAKE.decl('Arch', {
  10.  
  11.     blocksLevelsRegexp : /^local\/blocks/,
  12.     bundlesLevelsRegexp : /^local\/bundles$/,
  13.  
  14.     getBundlesLevels: function() {
  15.         return [
  16.             'local/bundles'
  17.         ];
  18.     }
  19. });
  20.  
  21.  
  22. MAKE.decl('BundleNode', {
  23.  
  24.     getTechs : function() {
  25.  
  26.         return [
  27.             'bemjson.js',
  28.             'bemdecl.js',
  29.             'deps.js',
  30.             'bemhtml',
  31.             'browser.js+bemhtml',
  32.             'scss',
  33.             'sass',
  34.             'html'
  35.         ];
  36.  
  37.     },
  38.  
  39.     getForkedTechs : function() {
  40.         return this.__base().concat(['browser.js+bemhtml', 'sass', 'scss']);
  41.     },
  42.  
  43.     getLevelsMap : function() {
  44.         return {
  45.             desktop : [
  46.                 'local/blocks'
  47.             ]
  48.         };
  49.     },
  50.  
  51.     getLevels : function() {
  52.         var resolve = PATH.resolve.bind(PATH, this.root),
  53.             buildLevel = this.getLevelPath().split('.')[0],
  54.             levels = this.getLevelsMap()[buildLevel] || [];
  55.  
  56.         return levels
  57.             .map(function(path) { return resolve(path); })
  58.             .concat(resolve(PATH.dirname(this.getNodePrefix()), 'blocks'));
  59.     },
  60.  
  61.     'create-css-node' : function(tech, bundleNode, magicNode) {
  62.         var source = this.getBundlePath('sass');
  63.         if(this.ctx.arch.hasNode(source)) {
  64.             return this.createAutoprefixerNode(tech, this.ctx.arch.getNode(source), bundleNode, magicNode);
  65.         }
  66.     }
  67.  
  68. });
  69.  
  70. MAKE.decl('AutoprefixerNode', {
  71.  
  72.     getBrowsers : function() {
  73.         return [
  74.             'last 2 versions',
  75.             'ie 10',
  76.             'opera 12.16'
  77.         ];
  78.     }
  79.  
  80. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement