From 94116dbad59dba489014d46f152b2233b00c8c43 Mon Sep 17 00:00:00 2001 From: Andrew Linfoot Date: Mon, 12 Jun 2017 13:19:54 -0700 Subject: [PATCH] Add documentation for supporting custom require types Summary: See https://github.com/facebook/metro-bundler/pull/4 Closes https://github.com/facebook/react-native/pull/14433 Differential Revision: D5230109 Pulled By: shergin fbshipit-source-id: f797218ad214dc3912ab3a9bcf837103502bfce4 --- docs/Images.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/Images.md b/docs/Images.md index 9de79b66b..5cd3519da 100644 --- a/docs/Images.md +++ b/docs/Images.md @@ -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.