[react-native] Make document.js into a polyfill. Fixes #1149

Summary:
@public
document shimming must run before anything else. However, we don't currently guarantee that. This moves the document shimming into `document.js` which is used as a polyfill.

Test Plan:
* start server
* go to playground app
* require `NativeModules` as the first thing
* open chrome debugger
* no error
This commit is contained in:
Amjad Masad 2015-05-13 17:45:36 -07:00
parent e5b939d623
commit 936f786765
1 changed files with 6 additions and 1 deletions

View File

@ -200,7 +200,12 @@ function getAppMiddleware(options) {
cacheVersion: '2',
transformModulePath: require.resolve('./transformer.js'),
assetRoots: options.assetRoots,
assetExts: ['png', 'jpeg', 'jpg']
assetExts: ['png', 'jpeg', 'jpg'],
polyfillModuleNames: [
require.resolve(
'../Libraries/JavaScriptAppEngine/polyfills/document.js'
),
],
});
}