Lesson 7: Is there any way to export deploy script tags with ES6 modules? #5578
Answered
by
alymurtazamemon
denissosnowsky
asked this question in
Q&A
-
I'm using es6 modules. What is a correct way to export tags in deploy script? I was trying 00-deploy-mocks.ts file: import { network } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import {
DECIMALS,
INITIAL_ANSWER,
developmentChains,
} from "../helper-hardhat-config";
const deploy = async ({
getNamedAccounts,
deployments,
}: HardhatRuntimeEnvironment) => {
const { deploy, log } = deployments;
const { deployer } = await getNamedAccounts();
if (developmentChains.includes(network.name)) {
log("Deploying mocks...");
await deploy("MockV3Aggregator", {
from: deployer,
log: true,
args: [DECIMALS, INITIAL_ANSWER],
});
log("Mocks deployed!");
}
};
export default deploy;
export const tags = ["all", "mocks"]; |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
May 31, 2023
Replies: 1 comment 1 reply
-
@denissosnowsky This is the way; export default deploy;
deploy.tags = ["all", "mocks"]; You can check my typescript repositories if you ever need anything link |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
denissosnowsky
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@denissosnowsky This is the way;
You can check my typescript repositories if you ever need anything link