Workaround for using symlinks in React Native.
Install the module globally.
npm install -g react-native-yunolink
and execute it in the root of a repository where you want to use the targetted Node.JS module(s). It supports
multiple targets by separating each path with a whitespace. In addition this will temporarily update the
watchFolders property in
metro.config.js to force Metro bundler to also watch your targetted modules.
rn-link [...targets]rn-link ../myModule1 ../myModule2
Or alternatively install the module as
npm install -D react-native-yunolink
And watch and copy the module from your
package.json by adding a
Run it with
npm run watch-myModule.
The CLI only has a single command available to start the module sync. If you need to ignore additional files or
folders pass a comma separated list to
--ignore. Ensure you always provide
If you want metro bundler to watch the linked folder for file changes and rebuild automatically, provide the
flag. Watching files is only possible if the symlinked folder has no duplicate modules in
-h are available for version description and help.
This module operates under the assumption
node_modules to the root of your app.
node_modules of the synced target will be excluded. This will prevent
@ProvidesModule errors in metro