Skip to content

Latest commit

 

History

History
24 lines (14 loc) · 782 Bytes

README.md

File metadata and controls

24 lines (14 loc) · 782 Bytes

react-native-smart-assets

Automatically generate an Images module from your image assets. Converts intelligently (e.g. PDF to @2x, @3x etc).

---Automatically-->

import Images from './Images';

...

<Image source={Images.myIcon} /> // Property name is same as file name. Automatically uses @2x, @3x.

Requirements

  • Mac OS X or Linux.
  • GhostScript is required to convert PDF assets into pre-rendered PNGs for different DPIs. Mac OS X users can use brew install gs.

Usage

./convert-assets.sh /assets_directory /output_directory

A directory named img and a script named Images.js will be added to the output directory. Existing ones will be removed.