Conversation

jmlee2k

Description

This PR will correctly update the public files map when files are added or removed in windows.

Fixes #15316.


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.

@bolt-new-by-stackblitzBolt.new (by StackBlitz)

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

file.slice(config.publicDir.length),
)
if (config.publicDir && publicFiles) {
const publicDir = normalizePath(config.publicDir)
Copy link
Member

Choose a reason for hiding this comment

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

Nice! Thanks for the fix 🙏🏼

Would you extract this as const normalizedPublicDir = normalizePath(config.publicDir) out of the function so it is precomputed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, done!

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@patak-devpatak-dev added regressionThe issue only appears after a new releasep3-minor-bugAn edge case that only affects very specific usage (priority)windows only labels Dec 11, 2023
@patak-devpatak-dev merged commit 921ca41 into vitejs:main Dec 11, 2023
@jmlee2k

Thanks for the quick merge and release!

Sign up for free to join this conversation on . Already have an account? Sign in to comment
p3-minor-bugAn edge case that only affects very specific usage (priority)regressionThe issue only appears after a new releasewindows only
None yet

Successfully merging this pull request may close these issues.

public files map isn't updated on file add/unlink in windows