-
Notifications
You must be signed in to change notification settings - Fork 83
/
package.js
47 lines (41 loc) · 1.16 KB
/
package.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
// jshint unused: false
var profile = (function () {
var miniExcludes = {
'dstore/README.md': 1,
'dstore/package': 1
};
var amdRegex = /\.js$/;
var isRqlRegex = /RqlQuery\.js/;
var isTestRegex = /\/tests\//;
var miniExcludeRegex = /\/(?:tests|demos|docs)\//;
var packages = {};
try {
// retrieve the set of packages for determining which modules to include
require([ 'util/build/buildControl' ], function (buildControl) {
packages = buildControl.packages;
});
}
catch (error) {
console.error('Unable to retrieve packages for determining optional package support in dstore');
}
return {
resourceTags: {
test: function (filename) {
return isTestRegex.test(filename);
},
miniExclude: function (filename, mid) {
return miniExcludeRegex.test(filename) || mid in miniExcludes;
},
amd: function (filename) {
return amdRegex.test(filename);
},
copyOnly: function (filename) {
// conditionally omit modules dependent on rql packages
return isTestRegex.test(filename) || (!packages.rql && isRqlRegex.test(filename));
}
},
trees: [
[ '.', '.', /(?:\/\.)|(?:~$)|(?:(?:html-report|node_modules)\/)/ ]
]
};
})();