Skip to content

Lesson 7: Hardhat Fund Me module.exports.tags = ["all", "mocks"]. Tags Usage [solved] #214

Answered by gmluqa
tinyhodler asked this question in Q&A
Discussion options

You must be logged in to vote

The tags are to specify what scripts will get ran when mentioning which tag.
For example, the code in your comment is the mock deploy, lets say we only want to run that one specific mock deploy script (in the deploy folder we have: 01-deploy-fund-me.js and just 00-deploy-mocks.js we just wanna deploy 00-deploy-mocks.js).
When we run yarn hardhat deploy, by default it runs every script in the deploy folder, so running yarn hardhat deploy would run 00-mocks.js and also 01-deploy-fund-me.js.
By adding module.exports.tags = ["all", "mocks"]; in the mock script, it allows us to run yarn hardhat deploy --tags mocks and our deploy command will only run scripts that have "mocks" in their module.…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tinyhodler
Comment options

@gmluqa
Comment options

@tinyhodler
Comment options

Answer selected by PatrickAlphaC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants