Ignore specific Solidity files in hardhat compilation to streamline your development workflow and avoid interruptions, as fast as possiblePhoto by Mohammad Mardani on Unsplash Introduction In Solidity, the hardhat tool is often used for compilation and testing. By default, hardhat will take all .sol files in your project and compile them. However, sometimes you may only want to compile a subset of these files, and ignore others that are in development or not ready for inclusion in the compilation. This can be useful when hardhat may emit errors for files in development, which can interrupt the compilation process for deployment or testing. In this article, we'll show you how to configure hardhat to ignore specific Solidity files during compilation, so you don't have to remove or rename the files temporarily to avoid errors. Setting up hardhat.config.js 1. Importing the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS Task The first step in configuring hardhat to ignore Solidity files is to import the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS task from the hardhat/builtin-tasks/task-names module. This task allows you to specify a filter function that will be applied to the list of source paths before they are passed to the Solidity compiler. To import this task, add the following line to your hardhat.config.js file: import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from "hardhat/builtin-tasks/task-names"; 2. Adding a Subtask to Filter Source Paths Once you have imported the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS task, you can add a subtask that sets the action for this task. The action should be a function that takes three arguments: the taskArgs, taskState, and runSuper function. In the function, you can call the runSuper function to get the list of source paths that would normally be passed to the Solidity compiler. Then, you can apply a filter function to this list to remove any paths that you don't want to include in the compilation. For example, you could use a filter like this: // Add a subtask that sets the action for the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS tasksubtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, __, runSuper) => { // Get the list of source paths that would normally be passed to the Solidity compiler const paths = await runSuper(); // Apply a filter function to exclude paths that contain the string "ignore" return paths.filter((p: any) => !p.includes("ignore"));}); This filter will exclude any paths that contain the string “ignore” from the list of source paths passed to the Solidity compiler. You can modify this filter as needed to suit your specific requirements. With the configuration provided in this article, you can add the string “ignore” to the names of any Solidity files that you don’t want to include in the compilation. For example, if you have a file named token.ignore.sol, hardhat will not include it in the compilation process. Conclusion In this article, we showed you how to configure hardhat to ignore specific Solidity files during compilation. By importing the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS task and adding a subtask with a custom filter function, you can control which files are included in the compilation process. This can be useful when working on large projects with many Solidity files, and can help you to focus on the files that are relevant to your current development tasks. It can also prevent hardhat from emitting errors for files in development, which can interrupt the compilation process for deployment or testing. Overall, using this method can help you to streamline your Solidity development workflow and improve the efficiency of your hardhat compilation and testing processes. `Want to Connect? You can find me on Twitter/Github/Discord` How to Ignore Solidity Files in Hardhat Compilation was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this storyIgnore specific Solidity files in hardhat compilation to streamline your development workflow and avoid interruptions, as fast as possiblePhoto by Mohammad Mardani on Unsplash Introduction In Solidity, the hardhat tool is often used for compilation and testing. By default, hardhat will take all .sol files in your project and compile them. However, sometimes you may only want to compile a subset of these files, and ignore others that are in development or not ready for inclusion in the compilation. This can be useful when hardhat may emit errors for files in development, which can interrupt the compilation process for deployment or testing. In this article, we'll show you how to configure hardhat to ignore specific Solidity files during compilation, so you don't have to remove or rename the files temporarily to avoid errors. Setting up hardhat.config.js 1. Importing the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS Task The first step in configuring hardhat to ignore Solidity files is to import the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS task from the hardhat/builtin-tasks/task-names module. This task allows you to specify a filter function that will be applied to the list of source paths before they are passed to the Solidity compiler. To import this task, add the following line to your hardhat.config.js file: import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from "hardhat/builtin-tasks/task-names"; 2. Adding a Subtask to Filter Source Paths Once you have imported the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS task, you can add a subtask that sets the action for this task. The action should be a function that takes three arguments: the taskArgs, taskState, and runSuper function. In the function, you can call the runSuper function to get the list of source paths that would normally be passed to the Solidity compiler. Then, you can apply a filter function to this list to remove any paths that you don't want to include in the compilation. For example, you could use a filter like this: // Add a subtask that sets the action for the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS tasksubtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, __, runSuper) => { // Get the list of source paths that would normally be passed to the Solidity compiler const paths = await runSuper(); // Apply a filter function to exclude paths that contain the string "ignore" return paths.filter((p: any) => !p.includes("ignore"));}); This filter will exclude any paths that contain the string “ignore” from the list of source paths passed to the Solidity compiler. You can modify this filter as needed to suit your specific requirements. With the configuration provided in this article, you can add the string “ignore” to the names of any Solidity files that you don’t want to include in the compilation. For example, if you have a file named token.ignore.sol, hardhat will not include it in the compilation process. Conclusion In this article, we showed you how to configure hardhat to ignore specific Solidity files during compilation. By importing the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS task and adding a subtask with a custom filter function, you can control which files are included in the compilation process. This can be useful when working on large projects with many Solidity files, and can help you to focus on the files that are relevant to your current development tasks. It can also prevent hardhat from emitting errors for files in development, which can interrupt the compilation process for deployment or testing. Overall, using this method can help you to streamline your Solidity development workflow and improve the efficiency of your hardhat compilation and testing processes. `Want to Connect? You can find me on Twitter/Github/Discord` How to Ignore Solidity Files in Hardhat Compilation was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story

How to Ignore Solidity Files in Hardhat Compilation

2025/09/09 21:43

Ignore specific Solidity files in hardhat compilation to streamline your development workflow and avoid interruptions, as fast as possible

Photo by Mohammad Mardani on Unsplash

Introduction

In Solidity, the hardhat tool is often used for compilation and testing. By default, hardhat will take all .sol files in your project and compile them. However, sometimes you may only want to compile a subset of these files, and ignore others that are in development or not ready for inclusion in the compilation. This can be useful when hardhat may emit errors for files in development, which can interrupt the compilation process for deployment or testing. In this article, we'll show you how to configure hardhat to ignore specific Solidity files during compilation, so you don't have to remove or rename the files temporarily to avoid errors.

Setting up hardhat.config.js

1. Importing the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS Task

The first step in configuring hardhat to ignore Solidity files is to import the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS task from the hardhat/builtin-tasks/task-names module. This task allows you to specify a filter function that will be applied to the list of source paths before they are passed to the Solidity compiler.

To import this task, add the following line to your hardhat.config.js file:

import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from "hardhat/builtin-tasks/task-names";

2. Adding a Subtask to Filter Source Paths

Once you have imported the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS task, you can add a subtask that sets the action for this task. The action should be a function that takes three arguments: the taskArgs, taskState, and runSuper function.

In the function, you can call the runSuper function to get the list of source paths that would normally be passed to the Solidity compiler. Then, you can apply a filter function to this list to remove any paths that you don't want to include in the compilation. For example, you could use a filter like this:

// Add a subtask that sets the action for the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS task
subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, __, runSuper) => {
// Get the list of source paths that would normally be passed to the Solidity compiler
const paths = await runSuper();

// Apply a filter function to exclude paths that contain the string "ignore"
return paths.filter((p: any) => !p.includes("ignore"));
});

This filter will exclude any paths that contain the string “ignore” from the list of source paths passed to the Solidity compiler. You can modify this filter as needed to suit your specific requirements.

With the configuration provided in this article, you can add the string “ignore” to the names of any Solidity files that you don’t want to include in the compilation. For example, if you have a file named token.ignore.sol, hardhat will not include it in the compilation process.

Conclusion

In this article, we showed you how to configure hardhat to ignore specific Solidity files during compilation. By importing the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS task and adding a subtask with a custom filter function, you can control which files are included in the compilation process. This can be useful when working on large projects with many Solidity files, and can help you to focus on the files that are relevant to your current development tasks. It can also prevent hardhat from emitting errors for files in development, which can interrupt the compilation process for deployment or testing. Overall, using this method can help you to streamline your Solidity development workflow and improve the efficiency of your hardhat compilation and testing processes.

`Want to Connect? You can find me on Twitter/Github/Discord`


How to Ignore Solidity Files in Hardhat Compilation was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.

Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact service@support.mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

Mitosis Price Flashes a Massive Breakout Hope; Cup-And-Handle Pattern Signals MITO Targeting 50% Rally To $0.115305 Level

Mitosis Price Flashes a Massive Breakout Hope; Cup-And-Handle Pattern Signals MITO Targeting 50% Rally To $0.115305 Level

The analyst identified a formation of a cup-and-handle pattern on Mitosis’s chart, suggesting that MITO is preparing to see a looming price explosion.
Share
Blockchainreporter2026/01/18 09:00
Spot ETH ETFs Surge: Remarkable $48M Inflow Streak Continues

Spot ETH ETFs Surge: Remarkable $48M Inflow Streak Continues

BitcoinWorld Spot ETH ETFs Surge: Remarkable $48M Inflow Streak Continues The cryptocurrency world is buzzing with exciting news as Spot ETH ETFs continue to capture significant investor attention. For the second consecutive day, these innovative investment vehicles have seen substantial positive flows, reinforcing confidence in the Ethereum ecosystem. This consistent performance signals a growing appetite for regulated crypto exposure among traditional investors. What’s Fueling the Latest Spot ETH ETF Inflows? On September 19, U.S. Spot ETH ETFs collectively recorded a net inflow of an impressive $48 million. This marked another day of positive momentum, building on previous gains. Such figures are not just numbers; they represent tangible capital moving into the Ethereum market through accessible investment products. BlackRock’s ETHA Leads the Charge: A standout performer was BlackRock’s ETHA, which alone attracted a staggering $140 million in inflows. This substantial figure highlights the significant influence of major financial institutions in driving the adoption of crypto-backed ETFs. Institutional Confidence: The consistent inflows, particularly from prominent asset managers like BlackRock, suggest increasing institutional comfort and conviction in Ethereum’s long-term potential. Why Are Consecutive Spot ETH ETF Inflows So Significant? Two consecutive days of net inflows into Spot ETH ETFs are more than just a fleeting trend; they indicate a strengthening pattern of investor interest. This sustained positive movement suggests that initial hesitancy might be giving way to broader acceptance and strategic positioning within the digital asset space. Understanding the implications of these inflows is crucial: Market Validation: Continuous inflows serve as a strong validation for Ethereum as a legitimate and valuable asset class within traditional finance. Liquidity and Stability: Increased capital flowing into these ETFs can contribute to greater market liquidity and potentially enhance price stability for Ethereum itself, reducing volatility over time. Paving the Way: The success of Spot ETH ETFs could also pave the way for other cryptocurrency-based investment products, further integrating digital assets into mainstream financial portfolios. Are All Spot ETH ETFs Experiencing the Same Momentum? While the overall picture for Spot ETH ETFs is overwhelmingly positive, it’s important to note that individual fund performances can vary. The market is dynamic, and different funds may experience unique flow patterns based on investor preferences, fund structure, and underlying strategies. Mixed Performance: On the same day, Fidelity’s FETH saw net outflows of $53.4 million, and Grayscale’s Mini ETH recorded outflows of $11.3 million. Normal Market Fluctuations: These outflows, while notable, are a normal part of market dynamics. Investors might be rebalancing portfolios, taking profits, or shifting capital between different investment vehicles. The net positive inflow across the entire sector indicates that new money is still entering faster than it is leaving. This nuanced view helps us appreciate the complex interplay of forces shaping the market for Spot ETH ETFs. What’s Next for Spot ETH ETFs and the Ethereum Market? The sustained interest in Spot ETH ETFs suggests a potentially bright future for Ethereum’s integration into traditional financial markets. As more investors gain access to ETH through regulated products, the demand for the underlying asset could increase, influencing its price and overall market capitalization. For investors looking to navigate this evolving landscape, here are some actionable insights: Stay Informed: Keep an eye on daily inflow and outflow data, as these can provide early indicators of market sentiment. Understand Diversification: While Spot ETH ETFs offer exposure, remember the importance of a diversified investment portfolio. Monitor Regulatory Developments: The regulatory environment for cryptocurrencies is constantly evolving, which can impact the performance and availability of these investment products. Conclusion: A Promising Horizon for Ethereum The consistent positive net inflows into Spot ETH ETFs for a second straight day underscore a significant shift in how institutional and retail investors view Ethereum. This growing confidence, spearheaded by major players like BlackRock, signals a maturing market where digital assets are increasingly seen as viable components of a modern investment strategy. As the ecosystem continues to develop, these ETFs will likely play a crucial role in shaping Ethereum’s future trajectory and its broader acceptance in global finance. It’s an exciting time to watch the evolution of these groundbreaking financial instruments. Frequently Asked Questions (FAQs) Q1: What is a Spot ETH ETF? A Spot ETH ETF (Exchange-Traded Fund) is an investment product that directly holds Ethereum. It allows investors to gain exposure to Ethereum’s price movements without needing to buy, store, or manage the actual cryptocurrency themselves. Q2: Why are these recent inflows into Spot ETH ETFs important? The recent inflows signify growing institutional and retail investor confidence in Ethereum as an asset. Consistent positive flows can lead to increased market liquidity, potential price stability, and broader acceptance of cryptocurrencies in traditional financial portfolios. Q3: Which funds are leading the inflows for Spot ETH ETFs? On September 19, BlackRock’s ETHA led the group with a substantial $140 million in inflows, demonstrating strong interest from a major financial institution. Q4: Do all Spot ETH ETFs experience inflows simultaneously? No, not all Spot ETH ETFs experience inflows at the same time. While the overall sector may see net positive flows, individual funds like Fidelity’s FETH and Grayscale’s Mini ETH can experience outflows due to various factors such as rebalancing or profit-taking by investors. Q5: What does the success of Spot ETH ETFs mean for Ethereum’s price? Increased demand through Spot ETH ETFs can potentially drive up the price of Ethereum by increasing buying pressure on the underlying asset. However, numerous factors influence crypto prices, so it’s not a guaranteed outcome. If you found this article insightful, consider sharing it with your network! Your support helps us continue to provide valuable insights into the dynamic world of cryptocurrency. Spread the word and help others understand the exciting developments in Spot ETH ETFs! To learn more about the latest crypto market trends, explore our article on key developments shaping Ethereum institutional adoption. This post Spot ETH ETFs Surge: Remarkable $48M Inflow Streak Continues first appeared on BitcoinWorld.
Share
Coinstats2025/09/20 11:10
Trump imposes 10% tariffs on eight European countries over Greenland.

Trump imposes 10% tariffs on eight European countries over Greenland.

PANews reported on January 18th that, according to Jinshi News, on January 17th local time, US President Trump announced via social media that, due to the Greenland
Share
PANews2026/01/18 08:46