Automatically generate an Images module from your image assets. Converts intelligently (e.g. PDF to @2x, @3x etc).
import Images from './Images';
...
<Image source={Images.myIcon} /> // Property name is same as file name. Automatically uses @2x, @3x.
- 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
.
./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.