fix: optimizeDeps.entries default ignore paths #7469
Merged
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.
Description
Fix #5131
Fix #2599
__tests__
from the ignore list ifoptimizeDeps.entries
is specifiedcoverage
to the ignore list ifoptimizeDeps.entries
is not explicitPing @tajo, @IanVS, @Akryum @edikdeisling, @JessicaSachs
Should we add other common folders? #2599 mentions
cypress-coverage
for example.Additional context
An interesting issue here is that adding a lot of entries to be scanned may have a big impact on cold start, even now that the scanning is non-blocking, we still need to finish it before being able to respond to dependencies requests.
@tajo tried it out in Ladle and got:
@JessicaSachs so for Cypress, you may need to choose between increasing cold start or being able to show something to the user and perform some reloads when finding missing deps.
One option for the future, we could add a new
optimizeDeps.lazyEntries
. The entries marked as lazy will be scanned but not pre-bundled and they will be added once the first missing dependency is found. So at least we only suffer from one full-reload on cold start, keeping the first load fast enough. For cypress, this may not be a good idea since every test may need to run, but for Storybook, Ladle, Historie this may be a good compromise.What is the purpose of this pull request?