This repository reproduces an issue with Foundry (tested with forge 0.2.0 (2d87c0c 2023-08-04T00:24:28.478338727Z)
).
This project defines a custom remapping to an npm package, and forge prioritizes the automatically generated one. This leads to a compilation error.
- Clone this repository
- Run
npm i
- Run
forge build
, which will fail.
This repository has a remapping from @prb/math
to node_modules/@prb/math/src/
.
forge
automatically maps @prb
to node_modules/@prb
.
As forge
prioritizes shorter remappings (as per this comment), so the automatically generated one takes presedence, mapping @prb/math
to node_modules/@prb/math
, instead of the desired node_modules/@prb/math/src/
.
forge
could give lower priority to automatically generated remappers, prioritizing the user's.