Strip dev only modules
Summary: public Make sure some modules that are only available in dev mode are only included in dev bundles. Depends on: D2663838 Reviewed By: davidaurelio Differential Revision: D2663889 fb-gh-sync-id: 42be40b865ef305828b3519556125af090ec61f4
This commit is contained in:
parent
9e670a64fc
commit
7a794cc72b
|
@ -180,11 +180,13 @@ function setUpNumber() {
|
|||
|
||||
function setUpDevTools() {
|
||||
// not when debugging in chrome
|
||||
if (__DEV__ && !window.document && require('Platform').OS === 'ios') {
|
||||
if (__DEV__) { // TODO(9123099) Strip `__DEV__ &&`
|
||||
if (!window.document && require('Platform').OS === 'ios') {
|
||||
var setupDevtools = require('setupDevtools');
|
||||
setupDevtools();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setUpProcessEnv();
|
||||
setUpConsole();
|
||||
|
@ -202,6 +204,8 @@ setUpDevTools();
|
|||
|
||||
// Just to make sure the JS gets packaged up. Wait until the JS environment has
|
||||
// been initialized before requiring them.
|
||||
if (__DEV__) {
|
||||
require('RCTDebugComponentOwnership');
|
||||
}
|
||||
require('RCTDeviceEventEmitter');
|
||||
require('PerformanceLogger');
|
||||
|
|
|
@ -10,16 +10,17 @@
|
|||
*/
|
||||
'use strict';
|
||||
|
||||
var Inspector = require('Inspector');
|
||||
var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
|
||||
var React = require('React');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
var Subscribable = require('Subscribable');
|
||||
var View = require('View');
|
||||
var WarningBox = require('WarningBox');
|
||||
|
||||
var invariant = require('invariant');
|
||||
|
||||
var Inspector = __DEV__ ? require('Inspector') : null;
|
||||
var WarningBox = __DEV__ ? require('WarningBox') : null;
|
||||
|
||||
var AppContainer = React.createClass({
|
||||
mixins: [Subscribable.Mixin],
|
||||
|
||||
|
@ -28,7 +29,7 @@ var AppContainer = React.createClass({
|
|||
},
|
||||
|
||||
toggleElementInspector: function() {
|
||||
var inspector = this.state.inspector
|
||||
var inspector = !__DEV__ || this.state.inspector
|
||||
? null
|
||||
: <Inspector
|
||||
rootTag={this.props.rootTag}
|
||||
|
|
Loading…
Reference in New Issue