mirror of https://github.com/status-im/metro.git
Adds packager configuration to support windows platform
Summary: This pull request is a prerequisite to enabling the react-native-windows platform extension. In the Resolver component, we need to add 'windows' to the list of platforms that are allowed in the DependencyGraph. We also need to add 'react-native-windows' (the name of the Windows platform extension NPM module) to the `providesModuleNodeModules` option. This allows the node_module folder check in the DependencyGraphHelper from node-haste to be bypassed for *.windows.js files in the Windows NPM package. For good measure, I also included a change to blacklist.js to ensure .windows.js files are ignored when the packager is parameterized on a platform. Closes https://github.com/facebook/react-native/pull/7639 Differential Revision: D3327771 Pulled By: mkonicek fbshipit-source-id: d1080b045ff6aa0cbf05d8070ceb0eb4cdb6dceb
This commit is contained in:
parent
e52076df73
commit
17f30d8666
|
@ -27,14 +27,22 @@ var platformBlacklists = {
|
|||
web: [
|
||||
'.ios.js',
|
||||
'.android.js',
|
||||
'.windows.js'
|
||||
],
|
||||
ios: [
|
||||
'.web.js',
|
||||
'.android.js',
|
||||
'.windows.js',
|
||||
],
|
||||
android: [
|
||||
'.web.js',
|
||||
'.ios.js',
|
||||
'.windows.js'
|
||||
],
|
||||
windows: [
|
||||
'.web.js',
|
||||
'.ios.js',
|
||||
'.android.js'
|
||||
],
|
||||
};
|
||||
|
||||
|
|
|
@ -95,13 +95,14 @@ class Resolver {
|
|||
providesModuleNodeModules: [
|
||||
'react',
|
||||
'react-native',
|
||||
'react-native-windows',
|
||||
// Parse requires AsyncStorage. They will
|
||||
// change that to require('react-native') which
|
||||
// should work after this release and we can
|
||||
// remove it from here.
|
||||
'parse',
|
||||
],
|
||||
platforms: ['ios', 'android'],
|
||||
platforms: ['ios', 'android', 'windows'],
|
||||
preferNativePlatform: true,
|
||||
fileWatcher: opts.fileWatcher,
|
||||
cache: opts.cache,
|
||||
|
|
Loading…
Reference in New Issue