@codechecks/build-size-watcher
Version:
Keep your build size in check and detect when it gets too big
18 lines • 463 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const gzipSize = require("gzip-size");
async function getSize(path, gzip) {
const stat = fs.statSync(path);
if (!stat.isFile()) {
throw new Error(`${path} is not a file!`);
}
if (gzip) {
return gzipSize.file(path);
}
else {
return stat.size;
}
}
exports.getSize = getSize;
//# sourceMappingURL=getSize.js.map