hardhat-dependency-compiler

Compile Solidity sources directly from NPM dependencies.

Usage no npm install needed!

<script type="module">
  import hardhatDependencyCompiler from 'https://cdn.skypack.dev/hardhat-dependency-compiler';
</script>

README

Hardhat Dependency Compiler

Compile Solidity sources directly from NPM dependencies.

Installation

yarn add --dev hardhat-dependency-compiler

Usage

Load plugin in Hardhat config:

require('hardhat-dependency-compiler');

Add configuration under the dependencyCompiler key:

| option | description | default | |-|-|-| | paths | Array of dependency paths to compile | [] | | path | path to ABI export directory (relative to Hardhat sources directory) | './hardhat-dependency-compiler' | | keep | whether to keep temporary file directory after compilation is complete (directory will still be deleted and regenerated on each compilation)| false |

dependencyCompiler: {
  paths: [
    '@openzeppelin/contracts/token/ERC20/IERC20.sol',
  ],
}