From d8cc6cc4c0e253e68cea317bef195fa9aa1dc078 Mon Sep 17 00:00:00 2001 From: tdzl2003 Date: Thu, 22 Sep 2016 06:45:29 +0800 Subject: [PATCH] bugfix: failed run with React Native 0.33 --- local-cli/src/bundle.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/local-cli/src/bundle.js b/local-cli/src/bundle.js index 0979963..5e56f57 100644 --- a/local-cli/src/bundle.js +++ b/local-cli/src/bundle.js @@ -365,10 +365,16 @@ export const commands = { const Config = require(path.resolve('node_modules/react-native/local-cli/util/Config')); const bundle = require(path.resolve('node_modules/react-native/local-cli/bundle/bundle')); - const defaultConfig = - Config.get(path.resolve('node_modules/react-native/local-cli'), - require(path.resolve('node_modules/react-native/local-cli/default.config')) - ); + let defaultConfig; + + if (major >= 0 && minor >= 33) { + defaultConfig= Config.get( + path.resolve('node_modules/react-native/local-cli'), + require(path.resolve('node_modules/react-native/local-cli/default.config')), + path.resolve('node_modules/react-native/packager/rn-cli.config.js')); + } else { + defaultConfig= Config.get(path.resolve('node_modules/react-native/local-cli'), require(path.resolve('node_modules/react-native/local-cli/default.config'))); + } if (bundle.func) { // React native after 0.31.0