Closed akinncar closed 2 years ago
For example, I want o use the lib/ directory when publishing the package on NPM, but use src/ directory to test locally without the need to compile on every change or change main on package.json
This is how it's already configured if you init a project with create-react-native-library
. You never need to compile it manually. Source code will be used during development and JS will be compiled automatically when publishing to npm
Main fields support
Can I have multiple entry files for different environments?
For example, I want o use the
lib/
directory when publishing the package on NPM, but usesrc/
directory to test locally without the need to compile on every change or change main on package.jsonPackage.json that I want:
But I have this error when I don't have the files compiled into the lib folder:
On README, you suggest using
react-native
param on the package.json entry file to easily debug, but it doesn't works (at least with expo).Repo that I need this behavior is https://github.com/akinncar/react-native-mask-text
Related: https://github.com/standard-things/esm/issues/794