diff --git a/package.json b/package.json index c47b3a787..beaf4f6d3 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "lint:js:fix": "eslint --ignore-path .gitignore . --fix", "lint:sol": "solhint 'contracts/**/*.sol' && prettier -c 'contracts/**/*.sol'", "lint:sol:fix": "prettier --write \"contracts/**/*.sol\"", - "prepublish": "rimraf build contracts/build artifacts cache", - "prepare": "env COMPILE_MODE=production npm run compile", + "clean": "hardhat clean && rimraf build contracts/build", + "prepare": "npm run clean && env COMPILE_MODE=production npm run compile", "prepack": "scripts/prepack.sh", "release": "scripts/release/release.sh", "version": "scripts/release/version.sh", diff --git a/scripts/prepare-contracts-package.sh b/scripts/prepare-contracts-package.sh index 66feb25a1..3f62fd419 100755 --- a/scripts/prepare-contracts-package.sh +++ b/scripts/prepare-contracts-package.sh @@ -5,7 +5,7 @@ cd "$(git rev-parse --show-toplevel)" # avoids re-compilation during publishing of both packages if [[ ! -v ALREADY_COMPILED ]]; then - npm run prepublish + npm run clean npm run prepare npm run prepack fi