[react-packager] Fix assetRoots when starting in node_modules

This commit is contained in:
Amjad Masad 2015-03-27 19:27:17 -07:00
parent e2404cd3dd
commit a895e62e6d
1 changed files with 5 additions and 1 deletions

View File

@ -68,9 +68,13 @@ if (options.assetRoots) {
if (!Array.isArray(options.assetRoots)) { if (!Array.isArray(options.assetRoots)) {
options.assetRoots = options.assetRoots.split(','); options.assetRoots = options.assetRoots.split(',');
} }
} else {
if (__dirname.match(/node_modules\/react-native\/packager$/)) {
options.assetRoots = [path.resolve(__dirname, '../../..')];
} else { } else {
options.assetRoots = [path.resolve(__dirname, '..')]; options.assetRoots = [path.resolve(__dirname, '..')];
} }
}
console.log('\n' + console.log('\n' +
' ===============================================================\n' + ' ===============================================================\n' +