Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/itsnickbarry/hardhat-dependency-compiler

📦 Compile Solidity sources directly from NPM dependencies
https://github.com/itsnickbarry/hardhat-dependency-compiler

blockchain buidler dependencies dependency ethereum hardhat npm smart-contracts solc solidity wow yarn

Last synced: about 11 hours ago
JSON representation

📦 Compile Solidity sources directly from NPM dependencies

Awesome Lists containing this project

README

        

# Hardhat Dependency Compiler

Compile Solidity sources directly from NPM dependencies.

## Installation

```bash
npm install --save-dev hardhat-dependency-compiler
# or
yarn add --dev hardhat-dependency-compiler
```

## Usage

Load plugin in Hardhat config:

```javascript
require('hardhat-dependency-compiler');
```

Add configuration under the `dependencyCompiler` key:

| option | description | default |
| ------- | -------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| `paths` | `Array` of dependency paths to compile | `[]` |
| `path` | path to temporary directory where dependencies are imported (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` |

```javascript
dependencyCompiler: {
paths: [
'@solidstate/contracts/interfaces/IERC20.sol',
],
}
```

## Development

Install dependencies via Yarn:

```bash
yarn install
```

Setup Husky to format code on commit:

```bash
yarn prepare
```