frostney / react-native-create-library

:notebook: Command line tool to create a React Native library with a single command
MIT License
1.45k stars 113 forks source link

Fix creating and building example and cleanup code around it #75

Closed maicki closed 6 years ago

maicki commented 6 years ago

This PR fixes running examples within libraries which didn't work before as the metro bundler was confused of multiple modules. The reason for that is that if we link the library via library-name: file:.. within the package.json of the example the node_modules folder of this library get's copied too what causes a multiple modules error at the end if react native tries to run.

This PR is adding a script to the library and executes it after running npm / yarn install within the example. The script looks into the node_modules folder of the example for the library and removes the node_modules within that libraries folder.

Fixes #69