mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +00:00
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:
parent
271de0f9b6
commit
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user