Skip to content

Commit

Permalink
Require modules from React Native as node modules. (#6715)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidaurelio authored and zpao committed May 16, 2016
1 parent 6afd510 commit 151e1d7
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,21 @@ var paths = {
},
};

var fbjsModuleMap = require('fbjs/module-map');
var moduleMap = {};
for (var key in fbjsModuleMap) {
moduleMap[key] = fbjsModuleMap[key];
}
var whiteListNames = [
'deepDiffer',
'deepFreezeAndThrowOnMutationInDev',
'flattenStyle',
'InitializeJavaScriptAppEngine',
'RCTEventEmitter',
'TextInputState',
'UIManager',
'View',
];

whiteListNames.forEach(function(name) {
moduleMap[name] = name;
});

moduleMap['object-assign'] = 'object-assign';
var moduleMap = Object.assign(
{'object-assign': 'object-assign'},
require('fbjs/module-map'),
{
deepDiffer: 'react-native/lib/deepDiffer',
deepFreezeAndThrowOnMutationInDev: 'react-native/lib/deepFreezeAndThrowOnMutationInDev',
flattenStyle: 'react-native/lib/flattenStyle',
InitializeJavaScriptAppEngine: 'react-native/lib/InitializeJavaScriptAppEngine',
RCTEventEmitter: 'react-native/lib/RCTEventEmitter',
TextInputState: 'react-native/lib/TextInputState',
UIManager: 'react-native/lib/UIManager',
UIManagerStatTracker: 'react-native/lib/UIManagerStatTracker',
View: 'react-native/lib/View',
}
);

var babelOpts = {
plugins: [
Expand Down

0 comments on commit 151e1d7

Please sign in to comment.