Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
react-native-asset
Advanced tools
Linking and unlinking of assets in your react-native app, works for fonts and sounds
react-native link
only supports font files, this tool supports all assets.react-native link
, you need to unlink the files manually.mp3
(to use with react-native-sound
) and ttf
files.Install
npm install -g react-native-asset
# or yarn
yarn global add react-native-asset
Add assets to your react-native.config.js
as you would with react-native link
...
assets: [
"./src/font",
"./src/mp3",
];
Add platform-specific assets to your react-native.config.js
like so:
...
assets: [
"./src/mp3",
],
iosAssets: [
"./src/font/ios",
],
androidAssets: [
"./src/font/android",
],
Run the command and linking + unlinking is automatic!
react-native-asset
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
!
-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.FAQs
Linking and unlinking of assets in your react-native app, works for fonts and sounds
We found that react-native-asset demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.