allow `rn.cli-config.js` w/o `getTransformModulePath`

Reviewed By: bestander

Differential Revision: D3509026

fbshipit-source-id: d7db3de13ecc92f6ddfdcec3029c78915e1e66c0
This commit is contained in:
David Aurelio 2016-07-01 06:56:11 -07:00 committed by Facebook Github Bot 8
parent e5b389e44c
commit 970f9335a9
3 changed files with 12 additions and 9 deletions

View File

@ -32,9 +32,10 @@ function buildBundle(args, config, output = outputBundle, packagerInstance) {
process.env.NODE_ENV = args.dev ? 'development' : 'production';
}
const transformModulePath = args.transformer ?
path.resolve(args.transformer) :
config.getTransformModulePath();
const transformModulePath =
args.transformer ? path.resolve(args.transformer) :
typeof config.getTransformModulePath === 'function' ? config.getTransformModulePath() :
undefined;
const options = {
projectRoots: config.getProjectRoots(),

View File

@ -54,9 +54,10 @@ function _dependencies(argv, config, resolve, reject, packagerInstance) {
reject(`File ${rootModuleAbsolutePath} does not exist`);
}
const transformModulePath = args.transformer ?
path.resolve(args.transformer) :
config.getTransformModulePath();
const transformModulePath =
args.transformer ? path.resolve(args.transformer) :
typeof config.getTransformModulePath === 'function' ? config.getTransformModulePath() :
undefined;
const packageOpts = {
projectRoots: config.getProjectRoots(),

View File

@ -69,9 +69,10 @@ function runServer(args, config, readyCallback) {
}
function getPackagerServer(args, config) {
const transformModulePath = args.transformer ?
path.resolve(args.transformer) :
config.getTransformModulePath();
const transformModulePath =
args.transformer ? path.resolve(args.transformer) :
typeof config.getTransformModulePath === 'function' ? config.getTransformModulePath() :
undefined;
return ReactPackager.createServer({
nonPersistent: args.nonPersistent,