react-native/local-cli
Nick Lockwood 81fb985335 Support non-image assets in packager
Summary:
public
The packager currently assumes that all assets that are not JSON or JS files must be images. Although it is possible to add other extension types, they crash the packager if you try to require them, because it attempts to get their dimensions, assuming that they are an image.

This is a crude workaround for that problem, which skips the image-specific processing for non-image assets, but really it would be better if the packager was properly aware of different asset types and treated them differently (e.g. for sounds it could include the duration, for HTML pages it could parse and include linked CSS files, etc).

I've also added an example of using `require('...')` to load a packager-managed HTML page in the UIExplorer WebView example. In future I anticipate that all static asset types (sounds, fonts, etc.) could be handled in this way, which allows them to be edited or added/removed on the fly instead of needing to restart the app.

Reviewed By: martinbigio

Differential Revision: D2895619

fb-gh-sync-id: cd93794ca66bad838621cd7df3ff3c62b5645e85
2016-02-03 17:30:39 -08:00
..
__mocks__ Fix more tests 2015-09-16 13:05:30 -07:00
__tests__ Temporarily disable cli tests 2015-11-12 07:05:01 -08:00
bundle Add ability to load “unbundles” to android 2016-01-21 14:13:50 -08:00
dependencies Use same options on dependencies and bundle commands 2016-01-11 15:31:33 -08:00
generate Revert "Add folders to attempt to unblock sync" 2015-10-26 22:48:10 +00:00
generator Update templates to ES2015 2015-12-25 02:17:30 -08:00
generator-android When using split builds, don't generate universal APK 2016-01-21 04:22:35 -08:00
generator-ios Improve react-native-xcode.sh integration 2016-01-25 12:36:33 -08:00
library Introduce react-native link 2015-10-27 11:22:28 -07:00
runAndroid fix run-android looking for packager in wrong place 2015-11-06 12:05:28 -08:00
runIOS Added `react-native run-ios` 2016-01-05 17:18:49 -08:00
server Support non-image assets in packager 2016-02-03 17:30:39 -08:00
upgrade Add warnings while upgrading RN with `react-native upgrade` 2016-01-05 09:58:28 -08:00
util Revert "Add folders to attempt to unblock sync" 2015-10-26 22:48:10 +00:00
cli.js chore: remove extra require 2016-01-17 18:17:39 -08:00
default.config.js More descriptive comment in default.config.js 2015-11-12 07:43:25 -08:00
generate-android.js Add license headers to local-cli 2015-10-20 09:55:21 -07:00
generator-utils.js Add license headers to local-cli 2015-10-20 09:55:21 -07:00
setup_env.bat Fix comments on .bat file 2015-10-28 21:36:07 -04:00
setup_env.sh Start packager through cli 2015-10-21 03:03:59 -07:00
wrong-react-native.js Return non-zero exit code from wrong-react-native 2016-01-05 15:22:59 -08:00