Skip to content

Conversation

antfu
Copy link
Member

@antfu antfu commented Dec 13, 2023

Description

Plugins could contribute to that list by simply pushing new items. While the order of them and duplicated items do not affect how deps works. We do a unique and sort, to make the hash calculation more stable.

Additional context

related: nuxt/nuxt#24196 (comment)


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines, especially the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

include: optimizeDeps?.include,
exclude: optimizeDeps?.exclude,
include: Array.from(new Set(optimizeDeps?.include)).sort(),
exclude: Array.from(new Set(optimizeDeps?.exclude)).sort(),
Copy link
Member

Choose a reason for hiding this comment

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

Nice one! Sounds good to me. We should still keep it as undefined if the option wasnt set though to avoid changing the hash for all the projects without explicit include/exclude and trigger a cold start for them

@patak-dev patak-dev merged commit 2b39fe6 into main Dec 13, 2023
@patak-dev patak-dev deleted the fix/optimization-hash-stable branch December 13, 2023 11:53
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.

2 participants