Home Code Package Exports Support in React Native · React Native

Package Exports Support in React Native · React Native

by TM

React Native 0.72 now includes beta support for the package.json “exports” field in Metro, the JavaScript build tool. This allows npm packages to specify entry points and improves how React Native projects work with the wider JavaScript ecosystem. The “exports” field can be used alongside or instead of the “main” field in a package.json file. It provides features such as package encapsulation, subpath aliases, and conditional exports. React Native app developers can enable Package Exports in their projects, which allows imports against packages that depend on Package Exports features to work as designed. However, enabling Package Exports brings some breaking changes that may affect specific projects. In a future React Native release, Package Exports will be enabled by default, allowing the ecosystem to move forward. Package maintainers can also take advantage of Package Exports to restrict access to their package’s internals and target React Native and React Native for Web more predictably.

Source link

You may also like

Leave a Comment

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?
-
00:00
00:00
Update Required Flash plugin
-
00:00
00:00