vite icon indicating copy to clipboard operation
vite copied to clipboard

fix(hmr): normalize the path info

Open btea opened this issue 10 months ago • 4 comments

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.

btea avatar Sep 01 '23 06:09 btea

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

stackblitz[bot] avatar Sep 01 '23 06:09 stackblitz[bot]

Before the modification, the slash was reversed, as shown in the figure below:

image

After modification, as shown in the figure below:

image

btea avatar Sep 04 '23 08:09 btea

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.

bluwy avatar Sep 04 '23 08:09 bluwy

Oh, I see what you mean, thanks for the clarification.

btea avatar Sep 04 '23 08:09 btea