Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add node10 entrypoint to Foundation (#2706)
Using node10 module resolution fails when importing Foundation, since the `exports` entry with multiple entrypoints is ignored. This PR adds a `main` fallback with an index that re-exports every submodule as a named object. So a user with node10 module resolution and targetting a commonjs module can do: ```ts import { sleep } from '@aztec/foundation'; async function main() { await sleep.sleep(1); } ``` While a user targetting node16 and up can do: ```ts import { sleep } from '@aztec/foundation/sleep'; async function main() { await sleep(1); } ``` Note that importing `@aztec/foundation` under node16 fails, since there is no `.` entrypoint under exports.
- Loading branch information