Closed Kingju777 closed 11 months ago
Environment: Windows 10; Vite 4.4.7
Issue:
fileObject
can contain a path that is only different tofile
in the separator that is used.example: fileObject[i].files[n] = "C:\Path\to\Folder/Foo.js" file = "C:\Path\to\Folder\Foo.js" => only the last separator before
Foo.js
is differentmy proposed solution: instead of
fileObject[i].files.includes(file)
fileObject[i].files.some(f => path.relative(f, file) === "")
Thank you for commenting on this bug for me!! As far as I see, this problem only occurs on window. This is the difference between the operating system's file association. Instead of the solution you suggested, we can check the current operating system and will decide whether to choose "/" or "\"
issue fixed version 1.2.1
Environment: Windows 10; Vite 4.4.7
Issue:
fileObject
can contain a path that is only different tofile
in the separator that is used.example: fileObject[i].files[n] = "C:\Path\to\Folder/Foo.js" file = "C:\Path\to\Folder\Foo.js" => only the last separator before
Foo.js
is differentmy proposed solution: instead of
fileObject[i].files.includes(file)
fileObject[i].files.some(f => path.relative(f, file) === "")