[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 71f08d2cb2
commit fc52ed6301

View File

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