[react-packager] Fix assetRoots when starting in node_modules, fixes #282 #252

This commit is contained in:
Amjad Masad 2015-03-26 17:42:32 -07:00
parent 8dc2c30a18
commit 4db001a925
1 changed files with 5 additions and 1 deletions

View File

@ -69,7 +69,11 @@ if (options.assetRoots) {
options.assetRoots = options.assetRoots.split(',');
}
} else {
options.assetRoots = [path.resolve(__dirname, '..')];
if (__dirname.match(/node_modules\/react-native\/packager$/)) {
options.assetRoots = [path.resolve(__dirname, '../../..')];
} else {
options.assetRoots = [path.resolve(__dirname, '..')];
}
}
console.log('\n' +