mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Require modules from React Native as node modules. (#6715)
This commit is contained in:
committed by
Paul O’Shannessy
parent
6afd51061a
commit
151e1d7014
36
gulpfile.js
36
gulpfile.js
@@ -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: [
|
||||
|
||||
Reference in New Issue
Block a user