mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 17:45:59 +00:00
12a68a8183
Summary: @public We're moving all the operation from `local-cli` to the `private-cli` and improving the code in the process. On this diff we introduce the `server` command which will be use to start the packager server. On follow up diffs we'll make changes to start using it from `local-cli`. Reviewed By: @vjeux Differential Revision: D2531443 fb-gh-sync-id: 5f7f12a250895265d83d1b076f6bbddb5cbdc257
41 lines
959 B
JavaScript
41 lines
959 B
JavaScript
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
/**
|
|
* React Native CLI configuration file
|
|
*/
|
|
'use strict';
|
|
|
|
const blacklist = require('./blacklist.js');
|
|
const path = require('path');
|
|
|
|
module.exports = {
|
|
getProjectRoots() {
|
|
return this._getRoots();
|
|
},
|
|
|
|
getAssetRoots() {
|
|
return this._getRoots();
|
|
},
|
|
|
|
getBlacklistRE() {
|
|
return blacklist('');
|
|
},
|
|
|
|
getTransformModulePath() {
|
|
return require.resolve('./transformer');
|
|
},
|
|
|
|
_getRoots() {
|
|
// match on either path separator
|
|
if (__dirname.match(/node_modules[\/\\]react-native[\/\\]packager$/)) {
|
|
// 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, '..')];
|
|
}
|
|
},
|
|
};
|