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

How can I create a “react native” library in Windows that is developed locally? #108

Closed muhamadzolfaghari closed 1 year ago

muhamadzolfaghari commented 5 years ago

Initially, I want to check it out and develop it using the example project of RNApp before publishing to the NPM a package for the RN library. Well, in order to do this, it is necessary to place in the example test project and inside the metro config in the blacklist containing the node_modules for the library, ie node_modules/react-native section in the black list. It does not interfere with project modules at runtime. I'm unable to determine the path in Windows so that the regex address for the folder is not executed, but I can put /node_modules/. With this, when practically running, none of the project's Node_modules is used and naturally should be. The main problem is the characters \ and / for addressing and determining the path so that even using the path.esolve problem remained. I've got the whole internet and github and stackoverflow for the three days, but I did not find a way. Problems also apply to linux and mac altogether. Before I need to install macOS or linux subsystem for this, Introduce me to be able to solve this conflict between projects.

└───my-library
    ├───example
    │   │   metro.config << (1)
    │   │
    │   └───node_modules
    │       └───react-native
    └───node_modules
        └───react-native << (2)

The structure of my project is in the form above and I want to use the metro.config in section (1) to put the entire internal contents of the directory in section (2) into its blacklist.