From fc52ed630112e420c77e40cc8c654fcf2ef3c5d3 Mon Sep 17 00:00:00 2001 From: Amjad Masad Date: Thu, 26 Mar 2015 17:42:32 -0700 Subject: [PATCH] [react-packager] Fix assetRoots when starting in node_modules, fixes #282 #252 --- packager/packager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packager/packager.js b/packager/packager.js index 119336edc9f572..9503df6ea42e51 100644 --- a/packager/packager.js +++ b/packager/packager.js @@ -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' +