-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathfiles.js
58 lines (54 loc) · 1.21 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
56
57
58
var pkg = require('./package.json');
var pkgFiles = {
angular: [
'node_modules/angular/angular.js'
],
karma: [
'node_modules/chai/chai.js',
'node_modules/sinon/pkg/sinon.js',
'node_modules/dirty-chai/lib/dirty-chai.js',
'node_modules/sinon-chai/lib/sinon-chai.js',
'test-helper.js',
'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.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;
};
}