UNPKG

hardhat

Version:

Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.

32 lines 1.42 kB
export { HardhatPluginError } from "@nomicfoundation/hardhat-errors"; import { registerLoadedPlugin } from "./internal/core/plugins/loaded-plugins-registry.js"; import { throwUsingHardhat2PluginError } from "./internal/using-hardhat2-plugin-errors.js"; const LAZY_LOADING_MIGRATION_HINT = "To migrate a plugin to Hardhat 3, export a plugin object with definePlugin from hardhat/plugins and register lazy-loaded logic through dependencies, hook handlers, and task actions."; /** * Defines a Hardhat plugin. * * Plugin authors should use this helper as the default export of their * plugin's `index` module. It registers the plugin's `id` in a process-wide * registry of loaded plugins, which the Hardhat CLI uses to detect plugins * that are imported but not included in the user's `plugins` array. * * @param plugin The plugin definition. * @returns The same plugin definition, unchanged. */ export function definePlugin(plugin) { registerLoadedPlugin(plugin); return plugin; } /** * @deprecated This function is part of the Hardhat 2 plugin API. */ export function lazyFunction(..._args) { throwUsingHardhat2PluginError("lazyFunction", LAZY_LOADING_MIGRATION_HINT); } /** * @deprecated This function is part of the Hardhat 2 plugin API. */ export function lazyObject(..._args) { throwUsingHardhat2PluginError("lazyObject", LAZY_LOADING_MIGRATION_HINT); } //# sourceMappingURL=plugins.js.map