vite
vite copied to clipboard
fix(hmr): normalize the path info
Description
Additional context
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.
- [ ] Read the Pull Request Guidelines and follow the PR Title Convention.
- [ ] 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
). - [ ] Ideally, include relevant tests that fail without this PR but pass with it.
Run & review this pull request in StackBlitz Codeflow.
Before the modification, the slash was reversed, as shown in the figure below:
After modification, as shown in the figure below:
Yeah I'm not really sure if there's a significant benefit for that. We also use path.relative
without normalizing in a few places, and I think the pattern is that if it's referencing an actual filesystem path, then we keep the backslash. If it's referencing a Rollup-style path, then we normalize it.
Oh, I see what you mean, thanks for the clarification.