UNPKG

hardhat-contract-sizer

Version:

Output Solidity contract sizes with Hardhat

16 lines (15 loc) 674 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const task_names_1 = require("hardhat/builtin-tasks/task-names"); const config_1 = require("hardhat/config"); (0, config_1.task)(task_names_1.TASK_COMPILE) .addFlag('noSizeContracts', "Don't size contracts after running this task, even if runOnCompile option is enabled") .setAction(async (args, hre, runSuper) => { await runSuper(); if (hre.config.contractSizer.runOnCompile && !args.noSizeContracts && !hre.__SOLIDITY_COVERAGE_RUNNING) { // Disable compile to avoid an infinite loop await hre.run('size-contracts', { noCompile: true }); } });