Permalink
Browse files

Add documentation for supporting custom require types

Summary:
See facebook/metro#4
Closes #14433

Differential Revision: D5230109

Pulled By: shergin

fbshipit-source-id: f797218ad214dc3912ab3a9bcf837103502bfce4
  • Loading branch information...
andrewlinfoot authored and facebook-github-bot committed Jun 12, 2017
1 parent 2e42842 commit 94116dbad59dba489014d46f152b2233b00c8c43
Showing with 3 additions and 1 deletion.
  1. +3 −1 docs/Images.md
View
@@ -67,7 +67,9 @@ Note that image sources required this way include size (width, height) info for
## Static Non-Image Resources
The `require` syntax described above can be used to statically include audio, video or document files in your project as well. Most common file types are supported including `.mp3`, `.wav`, `.mp4`, `.mov`, `.html` and `.pdf` (see the [packager defaults](https://github.com/facebook/react-native/blob/master/packager/defaults.js) file for the full list).
The `require` syntax described above can be used to statically include audio, video or document files in your project as well. Most common file types are supported including `.mp3`, `.wav`, `.mp4`, `.mov`, `.html` and `.pdf`. See [packager defaults](https://github.com/facebook/metro-bundler/blob/master/packages/metro-bundler/src/defaults.js#L13-L18) for the full list.
You can add support for other types by creating a packager config file (see the [packager config file](https://github.com/facebook/react-native/blob/master/local-cli/util/Config.js#L34-L39) for the full list of configuration options).
A caveat is that videos must use absolute positioning instead of `flexGrow`, since size info is not currently passed for non-image assets. This limitation doesn't occur for videos that are linked directly into Xcode or the Assets folder for Android.

0 comments on commit 94116db

Please sign in to comment.