Use default asset roots on `default.config.js`

Summary: We need to cherry pick this one as well.

cc ide
Closes https://github.com/facebook/react-native/pull/3640

Reviewed By: svcscm

Differential Revision: D2577961

Pulled By: mkonicek

fb-gh-sync-id: 3368fc02a931e0f259f3baa6706bd7d8586b0fbf
This commit is contained in:
Martin Bigio 2015-10-23 18:47:26 -07:00 коммит произвёл facebook-github-bot-5
Родитель 271de0f9b6
Коммит 47926abca9
1 изменённых файлов: 14 добавлений и 10 удалений

Просмотреть файл

@ -12,15 +12,7 @@ var path = require('path');
*/ */
var config = { var config = {
getProjectRoots() { getProjectRoots() {
if (__dirname.match(/node_modules[\/\\]react-native[\/\\]local-cli$/)) { return getRoots();
// packager is running from node_modules of another project
return [path.resolve(__dirname, '../../..')];
} else if (__dirname.match(/Pods[\/\\]React[\/\\]packager$/)) {
// packager is running from node_modules of another project
return [path.resolve(__dirname, '../../..')];
} else {
return [path.resolve(__dirname, '..')];
}
}, },
/** /**
@ -29,7 +21,7 @@ var config = {
* `./<image.extension>` don't require any entry in here. * `./<image.extension>` don't require any entry in here.
*/ */
getAssetRoots() { getAssetRoots() {
return []; return getRoots();
}, },
/** /**
@ -41,4 +33,16 @@ var config = {
} }
}; };
function getRoots() {
if (__dirname.match(/node_modules[\/\\]react-native[\/\\]local-cli$/)) {
// packager is running from node_modules of another project
return [path.resolve(__dirname, '../../..')];
} else if (__dirname.match(/Pods[\/\\]React[\/\\]packager$/)) {
// packager is running from node_modules of another project
return [path.resolve(__dirname, '../../..')];
} else {
return [path.resolve(__dirname, '..')];
}
}
module.exports = config; module.exports = config;