Do not return files with errors from ImportScanner#getOutputFiles.

This works whether or not the file object is a JsOutputResource.
This commit is contained in:
Ben Newman
2018-06-26 14:24:57 -04:00
parent 59eecf9dad
commit cf804f22e4

View File

@@ -671,6 +671,7 @@ export default class ImportScanner {
return this.outputFiles.filter(file => {
return file.absModuleId &&
! file[fakeSymbol] &&
! file.hasErrors &&
(! file.lazy ||
file.imported === true ||
file.imported === "dynamic");
@@ -820,6 +821,7 @@ export default class ImportScanner {
if (file.reportPendingErrors &&
file.reportPendingErrors() > 0) {
file.hasErrors = true;
// Any errors reported to InputFile#error were saved but not
// reported at compilation time. Now that we know the file has been
// imported, it's time to report those errors.