[react-packager] Don't cache rejected promise
This commit is contained in:
parent
34ed3a0cec
commit
749f6a69cd
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue