Link and unlink assets to your react-native project with ease!
react-native linkonly supports font files, this tool supports all assets.
- Unlinking is automatic when you delete an asset, with
react-native link, you need to unlink the files manually.
- Proper link (and unlink) for
mp3(to use with
npm install -g react-native-asset # or yarn yarn global add react-native-asset
- Add assets to your
react-native.config.jsas you would with
... "assets": [ "./src/font", "./src/mp3" ]
- Run the command and linking + unlinking is automatic!
react-native link you have to unlink the files manually, which is hard work.
Instead this library writes
link-assets-manifest.json to the root of
ios folders to keep track of the files which it added, for later removing it for you if missing from your
-p, --path- path to project, defaults to cwd.
-a, --assets- assets paths, for example
react-native-asset -a ./src/font ./src/mp3.
-ios-a, --ios-assets- ios assets paths, will disable android linking
-android-a, --android-assets- android assets paths, will disable ios linking.
-n-u, --no-unlink- Not to unlink assets which not longer exists, not recommanded.
- to use react-native 0.59 and below, use version 1.1.4