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:
Родитель
271de0f9b6
Коммит
47926abca9
|
@ -12,15 +12,7 @@ var path = require('path');
|
|||
*/
|
||||
var config = {
|
||||
getProjectRoots() {
|
||||
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, '..')];
|
||||
}
|
||||
return getRoots();
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -29,7 +21,7 @@ var config = {
|
|||
* `./<image.extension>` don't require any entry in here.
|
||||
*/
|
||||
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче