Skip to content

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
PrimeBoard:adds-.relative-deps-ignore-to-prevent-double-rebuild
Open

Add .relative-deps-ignore option, to solve double rebuild in TS / other compiled or built repos#56
vpiskunov wants to merge 2 commits intomweststrate:masterfrom
PrimeBoard:adds-.relative-deps-ignore-to-prevent-double-rebuild

Conversation

@vpiskunov
Copy link
Copy Markdown

This resolves #55 - Watch mode rebuilds multiple times.

The cause was that dist directory was not ignored for change detection.

This PR adds not just "static" dist directory ignore, but a flexible option of adding .relative-deps-ignore file into the Lib directory, to then specify !dist for example.

  • Works with multiple lines to specify multiple ignored dirs (!build, !.output)
  • Supports comments in .relative-deps-ignore (anything after # on any given line is ignored/skipped)
  • Readme updated to describe this option.

Please review & should be safe to merge! @mweststrate

Comment thread index.js Outdated
Comment thread index.js
Comment on lines +87 to +90
? fs.readFileSync(relativeDepsIgnoreFile, "utf8")
.split("\n")
.filter(line => line.trim() && !line.trim().startsWith('#'))
.map(line => line.split('#')[0])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watch mode rebuilds multiple times - resulting in the smallest lib taking 15s to be updated

3 participants