Skip to content

Commit

Permalink
Adds packager configuration to support windows platform
Browse files Browse the repository at this point in the history
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 facebook#7639

Differential Revision: D3327771

Pulled By: mkonicek

fbshipit-source-id: d1080b045ff6aa0cbf05d8070ceb0eb4cdb6dceb
  • Loading branch information
rozele authored and Facebook Github Bot 2 committed May 20, 2016
1 parent 149d0b9 commit ef21d99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packager/blacklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
],
};

Expand Down
3 changes: 2 additions & 1 deletion packager/react-packager/src/Resolver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ef21d99

Please sign in to comment.