forked from kissyteam/kissy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
32 lines (27 loc) · 877 Bytes
/
build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var fs = require('fs-extra');
var path = require('path');
var bowerDir = path.resolve(process.cwd(), 'bower_components');
var buildDir = path.resolve(process.cwd(), 'build');
function build(component, components) {
var cDir = path.resolve(bowerDir, component + '/build/');
if (!components) {
components = [component];
}
components.forEach(function (c) {
fs.copySync(path.resolve(cDir, c + '-debug.js'), path.resolve(buildDir, c + '-debug.js'));
fs.copySync(path.resolve(cDir, c + '.js'), path.resolve(buildDir, c + '.js'));
});
}
function builds(cs) {
cs.forEach(function (c) {
build(c);
});
}
//function builds2(cs) {
// cs.forEach(function (c) {
// build(c[0], c[1]);
// });
//}
build('xtemplate', ['xtemplate', 'xtemplate/runtime']);
builds(['util', 'querystring', 'path']);
console.log('done');