Files
squoosh/sizereport.config.js
Jake Archibald cd6db2d776 Using travis-size-report (#596)
* Using travis-size-report

* No maps in size report
2019-05-20 11:29:43 +01:00

15 lines
440 B
JavaScript

const escapeRE = require("escape-string-regexp");
module.exports = {
repo: "GoogleChromeLabs/squoosh",
path: "build/**/!(*.map)",
branch: "master",
findRenamed(path, newPaths) {
const nameParts = /^(.+\.)[a-f0-9]+(\..+)$/.exec(path);
if (!nameParts) return;
const matchRe = new RegExp(`^${escapeRE(nameParts[1])}[a-f0-9]+${escapeRE(nameParts[2])}$`);
return newPaths.find(newPath => matchRe.test(newPath));
}
};