Skip to content

Commit

Permalink
Do not hide files with errors on rebuilds caused by modified other fi…
Browse files Browse the repository at this point in the history
…les.
  • Loading branch information
Strate committed May 13, 2016
1 parent c589ca7 commit 8ae7eeb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,17 @@ function ensureTypeScriptInstance(loaderOptions: LoaderOptions, loader: any): {
})

// gather all errors from TypeScript and output them to webpack
let filesWithErrors: TSFiles = null
Object.keys(instance.modifiedFiles || instance.files)
.filter(filePath => !!filePath.match(/(\.d)?\.ts(x?)$/))
.forEach(filePath => {
let errors = languageService.getSyntacticDiagnostics(filePath).concat(languageService.getSemanticDiagnostics(filePath));
if (errors.length > 0) {
if (null === filesWithErrors) {
filesWithErrors = {}
}
filesWithErrors[filePath] = instance.files[filePath]
}

// if we have access to a webpack module, use that
if (hasOwnProperty(modules, filePath)) {
Expand Down Expand Up @@ -503,7 +510,7 @@ function ensureTypeScriptInstance(loaderOptions: LoaderOptions, loader: any): {
}
});

instance.modifiedFiles = null;
instance.modifiedFiles = filesWithErrors;
callback();
});

Expand Down

0 comments on commit 8ae7eeb

Please sign in to comment.