1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
dengyun 2017-09-22 22:08:53 +08:00
parent 7db4213bfd
commit efa0a5a279
2 changed files with 12 additions and 7 deletions

View File

@ -369,10 +369,14 @@ export const commands = {
await rmdir(realIntermedia);
await mkdir(realIntermedia);
require(path.resolve('node_modules/react-native/packager/babelRegisterOnly'))([
/private-cli\/src/,
/local-cli/,
]);
try {
require(path.resolve('node_modules/react-native/packager/babelRegisterOnly'))([
/private-cli\/src/,
/local-cli/,
]);
} catch (err) {
require('metro-bundler/src/babelRegisterOnly');
}
// This line fix issue #11
require(path.resolve('node_modules/react-native/local-cli/cli'));
@ -382,7 +386,9 @@ export const commands = {
let defaultConfig;
if (major >= 0 && minor >= 33) {
if (minor >= 42) {
if (minor >= 45) {
defaultConfig = Config.find(path.resolve('.'));
} else if (minor >= 42) {
defaultConfig= Config.get(
path.resolve('node_modules/react-native/local-cli'),
require(path.resolve('node_modules/react-native/local-cli/core/default.config')),
@ -406,7 +412,6 @@ export const commands = {
bundleOutput: `${realIntermedia}${path.sep}index.bundlejs`,
assetsDest: `${realIntermedia}`,
verbose: !!verbose,
transformer: require.resolve('react-native/packager/transformer'),
bundleEncoding: 'utf8',
});
} else {

View File

@ -1,6 +1,6 @@
{
"name": "react-native-update",
"version": "4.0.3",
"version": "4.0.5",
"description": "react-native hot update",
"main": "lib/index.js",
"scripts": {