This issue proposes replacing the current main and types fields in package.json with the exports field.
Using exports provides a clearer and more controlled way to define which modules can be imported by users. This helps prevent access to internal files or unsupported import paths.
It would also allow users to import submodules in a standardized way, such as:
instead of:
In addition, this may remove the need for index.js files that exist only for barrel exports.
This issue proposes replacing the current
mainandtypesfields inpackage.jsonwith theexportsfield.Using
exportsprovides a clearer and more controlled way to define which modules can be imported by users. This helps prevent access to internal files or unsupported import paths.It would also allow users to import submodules in a standardized way, such as:
instead of:
In addition, this may remove the need for
index.jsfiles that exist only for barrel exports.