1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

Merge pull request #205 from reactnativecn/sunnylqm-patch-2

Update bundle.js to fix metro path
This commit is contained in:
Sunny Luo 2018-05-30 02:22:51 -05:00 committed by GitHub
commit 2baa2bbb19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -369,13 +369,21 @@ export const commands = {
await rmdir(realIntermedia);
await mkdir(realIntermedia);
try {
require(path.resolve('node_modules/react-native/packager/babelRegisterOnly'))([
/private-cli\/src/,
/local-cli/,
]);
} catch (err) {
require('metro-bundler/src/babelRegisterOnly');
// ref: https://github.com/ds300/react-native-typescript-transformer/blob/master/index.js#L20
if (major === 0) {
if (minor >= 52) {
require('metro/src/babelRegisterOnly');
} else if (minor >= 47) {
require('metro-bundler/src/babelRegisterOnly');
} else if (minor === 46) {
require('metro-bundler/build/babelRegisterOnly');
} else {
// handle RN <= 0.45
require(path.resolve('node_modules/react-native/packager/babelRegisterOnly'))([
/private-cli\/src/,
/local-cli/,
]);
}
}
// This line fix issue #11