2 Star 1 Fork 0

shoy/Singer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.js 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
/**
* 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...');
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shoy/Singer.git
[email protected]:shoy/Singer.git
shoy
Singer
Singer
master

搜索帮助