From d1fc37b0b517aac94a85893e090ca3fafcb4a28f Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Fri, 13 May 2016 23:57:11 +0100 Subject: [PATCH] Require modules from React Native as node modules. --- gulpfile.js | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c3db76382cc4a..452d0362c3c63 100644 --- a/gulpfile.js +++ b/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: [