Skip to content

Commit

Permalink
Update build config
Browse files Browse the repository at this point in the history
* declare and reuse RegExp instances
* add /tests to copyOnly
* trees: configure ignore option for
  * hidden files (.*)
  * homedir files
  * html-report (Intern reporting info)
  * node_modules
  • Loading branch information
msssk committed Apr 16, 2020
1 parent e532531 commit 3847f6e
Showing 1 changed file with 40 additions and 28 deletions.
68 changes: 40 additions & 28 deletions package.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
var miniExcludes = {
// jshint unused: false
var profile = (function () {
var miniExcludes = {
'dstore/README.md': 1,
'dstore/package': 1
},
isTestRe = /\/test\//;
};
var amdRegex = /\.js$/;
var isRqlRegex = /RqlQuery\.js/;
var isTestRegex = /\/tests\//;
var miniExcludeRegex = /\/(?:tests|demos|docs)\//;
var packages = {};

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');
}
var profile = {
resourceTags: {
test: function (filename, mid) {
return isTestRe.test(filename);
},
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');
}

miniExclude: function (filename, mid) {
return /\/(?:tests|demos|docs)\//.test(filename) || mid in miniExcludes;
},
return {
resourceTags: {
test: function (filename) {
return isTestRegex.test(filename);
},

amd: function (filename, mid) {
return /\.js$/.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));
}
},

copyOnly: function (filename, mid) {
// conditionally omit modules dependent on rql packages
return (!packages['rql'] && /RqlQuery\.js/.test(filename));
}
}
};
trees: [
[ '.', '.', /(?:\/\.)|(?:~$)|(?:(?:html-report|node_modules)\/)/ ]
]
};
})();

0 comments on commit 3847f6e

Please sign in to comment.