-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathfiles.js
55 lines (51 loc) · 1.1 KB
/
files.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var pkg = require('./package.json');
var pkgFiles = {
angular: [
'bower_components/angular/angular.js'
],
karma: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'mock/socket-io.js',
'bower_components/sails.io.js/sails.io.js'
],
'karma-build': [
'@karma',
'build/' + pkg.name + '.js',
'@karma-tests'
],
'karma-min': [
'@karma',
'build/' + pkg.name + '.min.js',
'@karma-tests'
],
'karma-src': [
'@karma',
'@src',
'@karma-tests'
],
'karma-tests': [
'test/**/*.spec.js'
],
src: [
'src/**/*.js',
]
};
if (module.exports) {
module.exports.files = pkgFiles;
module.exports.mergeFilesFor = function() {
var files = [];
Array.prototype.slice.call(arguments, 0).forEach(function(filegroup) {
pkgFiles[filegroup].forEach(function(file) {
// replace @ref
var match = file.match(/^\@(.*)/);
if (match) {
files = files.concat(pkgFiles[match[1]]);
} else {
files.push(file);
}
});
});
return files;
};
}