return function(target) { library.addSources(target, __dirname, mapSources({ '$.autogrowinput': 'source/croc/vendor/jquery.autogrowinput.js', '$.autosize': 'source/croc/vendor/jquery.autosize.fixed.js', '$.history': 'source/croc/vendor/jquery.history.js' })); if (options && options.add) { library.addSources(target, mapSources(options.add)); } };
return function(target) { library.addSources(target, [{ path: options.path, mask: '*/.bower.json', symbol: function(ref) { return 'bower:' + ref.split('/')[0]; } }]); };
return function(target) { var general = { type: 'css', mask: '*/*.css', symbol: function(ref) { var symbol = ref.split('/'); return symbol[1] === 'index' ? symbol[0] : symbol.join('.'); } }; var add = options.add || []; var start = -add.length - 1; library.addSources(target, __dirname, [_.assign({ path: 'source/croc/css/blocks', weight: start }, general)]); add.forEach(function(curPath, i) { library.addSources(target, [_.assign({ path: curPath, weight: start + i + 1 }, general)]); }); };
function(target) { var tplRE = /\{\{(?:(?:if|each|ueach|on|unless|with) |=|\*)?(.+?)(?: as .*?)?}}/g; library.addOptions(target, { htmlSymbolRegexp: [ /\bis\s*=\s*['"]([\w\d_]+\.[\w\d_\.]+)["']/g ], tplJs: [function(source) { var match; var code = []; while (match = tplRE.exec(source)) { // jshint ignore:line code.push(match[1]); } return code.join(';'); }] }); var addSymbols = [ '.View', '.css', '.css.mobile', '.css.-mobile', '.css.desktop', '.css.-desktop', '.css.pad', '.css.-pad' ]; var deps = function(ref, symbol, type) { if (type === 'js' || type === 'wtpl') { return _.zipObject(addSymbols.map(function(x) { return [symbol + x, 'followOptional']; })); } }; library.addSources(target, __dirname, [ { path: { 'source/croc/cmp': 'croc.cmp.', 'source/croc/js': 'croc.' }, symbol: function(ref) { return ref === 'core' ? 'croc' : ':default'; }, dependencies: deps, type: ['js', 'wtpl', 'css'] } ]); var pathObj = {}; options.apps.forEach(function(appPath) { var name = path.basename(appPath); pathObj[path.join(appPath, 'cmp')] = name + '.cmp.'; pathObj[path.join(appPath, 'js')] = name + '.'; }); library.addSources(target, [ { path: pathObj, dependencies: deps, //todo add jtpl, coffee type: ['js', 'wtpl', 'css'] } ]); target.include = [ '!!' + __dirname + '/source/croc/css/common.css', 'b-html', 'croc.package', 'croc.Compatibility', 'croc', 'croc.utils', 'croc.controllers.Initialize' ].concat(target.include || []); }];
add.forEach(function(curPath, i) { library.addSources(target, [_.assign({ path: curPath, weight: start + i + 1 }, general)]); });