Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: public files map will be updated on add/unlink in windows #15317

Merged
merged 2 commits into from Dec 11, 2023

Conversation

jmlee2k
Copy link
Contributor

@jmlee2k jmlee2k commented Dec 11, 2023

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.

Copy link

stackblitz bot commented Dec 11, 2023

Review PR in StackBlitz Codeflow Run & 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-dev patak-dev added regression The issue only appears after a new release p3-minor-bug An edge case that only affects very specific usage (priority) windows only labels Dec 11, 2023
@patak-dev patak-dev merged commit 921ca41 into vitejs:main Dec 11, 2023
10 checks passed
@jmlee2k
Copy link
Contributor Author

jmlee2k commented Dec 12, 2023

Thanks for the quick merge and release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release windows only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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