Add .relative-deps-ignore option, to solve double rebuild in TS / other compiled or built repos#56
Open
vpiskunov wants to merge 2 commits intomweststrate:masterfrom
Conversation
elektronik2k5
approved these changes
Jun 24, 2023
Comment on lines
+87
to
+90
| ? fs.readFileSync(relativeDepsIgnoreFile, "utf8") | ||
| .split("\n") | ||
| .filter(line => line.trim() && !line.trim().startsWith('#')) | ||
| .map(line => line.split('#')[0]) |
Collaborator
There was a problem hiding this comment.
So in addition to checking that the file exists, there may be other causes of errors in reading the file contents (such as a lack of permissions, or the file may be huge and fail to be read into memory or a number of other issues).
To mitigate that, at the very least this block needs to be wrapped in try/catch. But instead of trying to mitigate all possible issues here, I'm sure there's a package which handles reading/parsing .gitignore format instead.
Co-authored-by: Nick Ribal <elektronik2k5@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This resolves #55 - Watch mode rebuilds multiple times.
The cause was that
distdirectory was not ignored for change detection.This PR adds not just "static"
distdirectory ignore, but a flexible option of adding.relative-deps-ignorefile into the Lib directory, to then specify!distfor example.!build, !.output).relative-deps-ignore(anything after#on any given line is ignored/skipped)Please review & should be safe to merge! @mweststrate