Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#163 #147 These issues are related. "type": "module" was removed but in our instance this actually causes issues for NextJS when trying to import (named imports specifically) from mafs, such as: ![image](https://github.com/user-attachments/assets/3704e279-cea0-4bc9-9fff-d7350657ec88) I think the correct solution should have been to keep "type": "module" and use the "cjs" extension for the CJS output. That fixes both our issues and those listed in the 2 issues above, removing the type module field and using .mjs unfortunately only solves the issue for CJS users, but not for ESM users. Even better is to just use package entrypoints so there is no confusion. Reason being that the "module" field next to the "main" field is an unspecced conventional field that only *some* tools respect, and "main" is technically a legacy field now. The future-proof method is package entrypoints, and has the benefit of locking down your public API, which means users won't accidentally rely on private API by using direct filepath imports. This gives the maintainer the freedom to structure the published files in any way they please without causing breaking changes. --------- Co-authored-by: Steven Petryk <petryk.steven@gmail.com>
- Loading branch information