The easiet implementation of the tool is to leverage rjs build time hooks, in our case we are leveraging done as added in the grunt-contrib-requirejs plugin. r.js build analysis leverages the format of manifest of build.txt that r.js provides in the case of the plugin we use the contents of that file provided directly via stdio. You could read the build.txt and invoke the analysis on that as well.
{
done: function(done, response) {
var status = true;
var duplicates = analyzer.duplicates(response, {
exclude: ['publications/public/app.js']
});