mirror of https://github.com/status-im/metro.git
[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:
parent
e5b939d623
commit
936f786765
|
@ -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'
|
||||
),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue