Skip to content

Export Solidity contract paths for Hardhat 3 npmFilesToBuild #261

@zZoMROT

Description

@zZoMROT

Hi! In Hardhat >= 3, hardhat-dependency-compiler is no longer needed (and no longer supported) because Hardhat has built-in dependency compilation via solidity.npmFilesToBuild.

I tried to use TokenMock.sol from this package like this:

export default {
  solidity: {
    npmFilesToBuild: [
      '@1inch/solidity-utils/contracts/mocks/TokenMock.sol',
    ],
  },
};

But Hardhat fails with:

Error HHE901: The file "contracts/mocks/TokenMock.sol" is not exported by the package.

The file exists in the package, but package.json exports does not expose Solidity contract paths such as:

./contracts/mocks/TokenMock.sol
./contracts/*

Could you please export the Solidity contracts path so Hardhat 3 can compile them through npmFilesToBuild?

For example, something like:

{
  "exports": {
    ".": "./dist/src/index.js",
    "./hardhat-setup": "./dist/hardhat-setup/index.js",
    "./docgen": "./dist/docgen/index.js",
    "./contracts/*": "./contracts/*"
  }
}

This would make the package compatible with Hardhat 3 dependency compilation without relying on the old Hardhat 2 plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions