bonsai-analyzer
Version:
Trim your dependency tree.
42 lines (30 loc) • 1.29 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = main;
var _getParser = _interopRequireDefault(require("./getParser"));
var _resolveArgs = _interopRequireDefault(require("./resolveArgs"));
var _chunkSizes = _interopRequireDefault(require("../stats/chunkSizes"));
var _chunkSizesDiff = _interopRequireDefault(require("../stats/chunkSizesDiff"));
var _fileSystemHelper = require("./fileSystemHelper");
const parser = (0, _getParser.default)();
function main() {
run((0, _resolveArgs.default)(parser.parseArgs()));
}
function run(flags) {
if (process.env.VERBOSE) {
console.log('Invoking', flags); // eslint-disable-line no-console
}
switch (flags.command) {
case 'chunk-sizes':
console.log( // eslint-disable-line no-console
(0, _chunkSizes.default)((0, _fileSystemHelper.openRawStatsFile)(flags.statsFile)));
break;
case 'chunk-sizes-diff':
console.log( // eslint-disable-line no-console
(0, _chunkSizesDiff.default)((0, _chunkSizes.default)((0, _fileSystemHelper.openRawStatsFile)(flags.fileA)), (0, _chunkSizes.default)((0, _fileSystemHelper.openRawStatsFile)(flags.fileB))));
break;
}
}