代码拉取完成,页面将自动刷新
/**
* Created by luoyong on 2015/8/4.
*/
var fs = require('fs');
var path = require('path');
var bowerDir = path.resolve(process.cwd(), 'bower_components');
var buildDir = path.resolve(process.cwd(), 'build_singer');
var aggregateBower = require('aggregate-bower');
var inferBaseCode = 'modulex.init({name:"seed"});';
var kgConfigContent = 'modulex.config({ packages : { kg : { base : "//g.alicdn.com/kg/" }}});';
var extraContent = ['', inferBaseCode, kgConfigContent].join('\n');
function generateSeedJs() {
var seedDebugJsContent = '',
seedJsContent = '',
filesList = ['modulex', 'feature', 'ua', 'meta'];
for (var i = 0; i < filesList.length; i++) {
var debugFilePath = path.join(buildDir, filesList[i] + '-debug.js'),
miniFilePath = path.join(buildDir, filesList[i] + '.js');
if (fs.existsSync(debugFilePath)) {
seedDebugJsContent += fs.readFileSync(debugFilePath).toString();
seedJsContent += fs.readFileSync(miniFilePath).toString();
}
}
fs.writeFileSync(path.join(buildDir, 'seed-debug.js'), seedDebugJsContent + extraContent);
fs.writeFileSync(path.join(buildDir, 'seed.js'), seedJsContent + extraContent);
}
aggregateBower(bowerDir, buildDir);
generateSeedJs();
console.log('done...');
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。