Skip to content

Commit

Permalink
fix: include files that are outside project context (#437)
Browse files Browse the repository at this point in the history
In the case that the referenced project was outside the webpack context, changes didn't update the issues list.
  • Loading branch information
piotr-oles committed Jun 4, 2020
1 parent 1f7ae0d commit c4796b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
12 changes: 1 addition & 11 deletions src/hooks/getChangedFiles.ts
Expand Up @@ -15,17 +15,7 @@ function getChangedFiles(compiler: webpack.Compiler): string[] {
changedFiles = Object.keys((watcher && watcher.mtimes) || {});
}

return (
changedFiles
// normalize paths
.map((changedFile) => path.normalize(changedFile))
// check if path is inside the context to filer-out some trash from fs
.filter(
(changedFile) =>
!compiler.options.context ||
changedFile.startsWith(path.normalize(compiler.options.context))
)
);
return changedFiles.map((changedFile) => path.normalize(changedFile));
}

export { getChangedFiles };
12 changes: 1 addition & 11 deletions src/hooks/getDeletedFiles.ts
Expand Up @@ -17,17 +17,7 @@ function getDeletedFiles(
deletedFiles = [...state.removedFiles];
}

return (
deletedFiles
// normalize paths
.map((changedFile) => path.normalize(changedFile))
// check if path is inside the context to filer-out some trash from fs
.filter(
(changedFile) =>
!compiler.options.context ||
changedFile.startsWith(path.normalize(compiler.options.context))
)
);
return deletedFiles.map((changedFile) => path.normalize(changedFile));
}

export { getDeletedFiles };

0 comments on commit c4796b2

Please sign in to comment.