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:
Eric Rozell 2016-05-20 05:27:13 -07:00 committed by Facebook Github Bot 2
parent e52076df73
commit 17f30d8666
2 changed files with 10 additions and 1 deletions

View File

@ -27,14 +27,22 @@ var platformBlacklists = {
web: [ web: [
'.ios.js', '.ios.js',
'.android.js', '.android.js',
'.windows.js'
], ],
ios: [ ios: [
'.web.js', '.web.js',
'.android.js', '.android.js',
'.windows.js',
], ],
android: [ android: [
'.web.js', '.web.js',
'.ios.js', '.ios.js',
'.windows.js'
],
windows: [
'.web.js',
'.ios.js',
'.android.js'
], ],
}; };

View File

@ -95,13 +95,14 @@ class Resolver {
providesModuleNodeModules: [ providesModuleNodeModules: [
'react', 'react',
'react-native', 'react-native',
'react-native-windows',
// Parse requires AsyncStorage. They will // Parse requires AsyncStorage. They will
// change that to require('react-native') which // change that to require('react-native') which
// should work after this release and we can // should work after this release and we can
// remove it from here. // remove it from here.
'parse', 'parse',
], ],
platforms: ['ios', 'android'], platforms: ['ios', 'android', 'windows'],
preferNativePlatform: true, preferNativePlatform: true,
fileWatcher: opts.fileWatcher, fileWatcher: opts.fileWatcher,
cache: opts.cache, cache: opts.cache,