Skip to content

Commit 4030771

Browse files
committed
add helper noted to debug hardhat using local checkout
1 parent 3b73f16 commit 4030771

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

contracts/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## HARDHAT local checkout tips
2+
3+
In order to have a local checkout of Hardhat (for debug purposes lets say) one needs to:
4+
- Git clone hardhat locally -> lets say: `dollar/dependancies/hardhat` And switch to correct tag
5+
- After altering code in hardhat-core or any other package run: `cd ../dependancies/hardhat/ && yarn run build && cd - && yarn remove hardhat && rm -rf node_modules/.bin/hardhat && yarn add file:./../dependancies/hardhat/packages/hardhat-core --dev && yarn run node:fork` Adjust the command if the package being altered is not hardhat-core
6+
7+
### why is this necessary:
8+
- yarn run build compiles the hardhat typescript files to javascript files
9+
- only managed to get it working by removing hardhat project dependency and re-adding it. And yarn / npm link command didn't get picked up by npx. So project is added using yarn local file option -> file:/path/to/repo
10+
- and node_modules/.bin/hardhat needs to get deleted because that is where npx has its compile cache. And typescript compilation wasn't always triggered by npx when it should be
11+
- it is good to use the --no-install npx parameter. Npx has this "cool" feature where dependencies that it can not resolve (like yarn links for example) get downloaded on the fly. With --no-install npx won't attempt any downloads.

0 commit comments

Comments
 (0)