diff --git a/packager/react-packager/src/JSTransformer/index.js b/packager/react-packager/src/JSTransformer/index.js index fde8336e0..abfae2482 100644 --- a/packager/react-packager/src/JSTransformer/index.js +++ b/packager/react-packager/src/JSTransformer/index.js @@ -61,9 +61,7 @@ function Transformer(options) { projectRoots: options.projectRoots, }); - if (options.transformModulePath == null) { - this._failedToStart = Promise.reject(new Error('No transfrom module')); - } else { + if (options.transformModulePath != null) { this._workers = workerFarm( {autoStart: true, maxConcurrentCallsPerWorker: 1}, options.transformModulePath @@ -83,8 +81,8 @@ Transformer.prototype.invalidateFile = function(filePath) { }; Transformer.prototype.loadFileAndTransform = function(filePath) { - if (this._failedToStart) { - return this._failedToStart; + if (this._transform == null) { + return Promise.reject(new Error('No transfrom module')); } var transform = this._transform;