JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 31237
  • Score
    100M100P100Q142836F
  • License ISC

Linking and unlinking of assets in your react-native app, works for fonts and sounds

Package Exports

  • react-native-asset

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-asset) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-native-asset

npm versionBuild Status

Check out this starter-kit to use your assets with even more simplicity.

Usage

  • Install
    npm install -g react-native-asset
    # or yarn
    yarn global add react-native-asset
  • Add assets to you package json as you would with react-native link
    ...
     "rnpm": {
        "assets": [
          "./src/font",
          "./src/mp3"
        ]
     }
  • Run the command and linking + unlinking is automatic!
    react-native-asset

Exaplain

With 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 android and ios folders to keep track of the files which it added, for later removing it for you if missing from your assets!

Parameters

  • -p, --path - path to project, defaults to cwd.
  • -a, --assets - assets paths, for example react-native-asset -a ./src/font ./src/mp3.
  • -ios-a, --iosassets - ios assets paths, will disable android linking
  • -android-a, --androidassets - android assets paths, will disable ios linking.
  • -n-u, --no-unlink - Not to unlink assets which not longer exists, not recommanded.