-
Hello 👋 . |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Just remove |
Beta Was this translation helpful? Give feedback.
-
@satya164 need your help While creating a React Native library using TurboModules, I want to exclude the src folder from the final npm package. My TypeScript code lives in src/ I transpile to lib/ or dist/ before publishing When I remove src from the published package (via .npmignore or files field in package.json), I face the following issue when installing the library in another React Native project: Error: ENOENT: no such file or directory, lstat '.../node_modules/mylibrary/src' This happens because React Native Codegen (triggered during pod install) is still trying to read the src folder, even though only lib/ should be required at runtime. Expected Behavior I should be able to ship only compiled files (lib/, dist/) in my npm package. src folder should not be required in consuming apps. Codegen should work with compiled output instead of raw src. Actual Behavior Without src, pod install fails with the above error. This makes it impossible to hide implementation details when distributing the library. Steps to Reproduce Create a TurboModule library with TypeScript sources in src/. Add a build step (tsc or Babel) to generate lib/. Exclude src from package.json "files" or .npmignore. Pack and install the library in another RN app. Run pod install → ❌ Error: ENOENT: .../node_modules/mylibrary/src. |
Beta Was this translation helpful? Give feedback.
Just remove
src
fromfiles
,react-native
entry, and disablesourceMaps