1.0.1 • Published 1 year ago

hardhat-flat-exporter v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

npm version Build Status buidler

hardhat-flat-exporter

Export flat contract on compilation via Hardhat.

👾 Additional supplement to the official flatten command

Installation

npm install --save-dev hardhat-flat-exporter
# or
yarn add --dev hardhat-flat-exporter

And add the following to your hardhat.config.js:

require("hardhat-flat-exporter");

Or, if you are using TypeScript, add this to your hardhat.config.ts:

import "hardhat-flat-exporter";

Configuration

Configuration is optional.

module.exports = {
  flattenExporter: {
    src: "./contracts",
    path: "./flat",
    clear: true,
  },
};

Options

optiondescriptiondefault
srcfolder path of the target contracts (relative to Hardhat root)'./contracts'
pathpath to flat sol export directory (relative to Hardhat root)'./flat'
clearwhether to delete old flat sol files in path on compilationtrue

Usage

The included Hardhat tasks may be run manually:

npx hardhat export-flat
# or
yarn run hardhat export-flat