mirror of https://github.com/status-im/metro.git
[react-packager] Don't cache rejected promise
This commit is contained in:
parent
d476461120
commit
e22b4e000b
|
@ -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