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: build path error on Windows #7383
Conversation
fcb5ede
to
a50601d
Compare
I'm not sure how to add a test for this. If you could point me to where it would be and if there is a similar test, I could have a go at adding one. |
We have a guide for adding new tests here https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md#extending-the-test-suite. We have tests for rollup inputs here https://github.com/vitejs/vite/blob/main/packages/playground/html/vite.config.js. If your example works in plain rollup, we may want to add one path without resolving there to test this. |
Unfortunately, I can't figure out how to make the test work. I got them running and passing, and I can even get all the tests in the html.spec.test suite to fail when in
As I've spent a few hours on this already, I don't really want to spend much more time on this. I'd be happy to follow some specific instructions, if it doesn't take me more than 30 minutes. Otherwise, I hope it's ok that I don't add a unit test. |
Description
When the build input is specified, on Windows the build fails with an error and a weird path:
The issue seems to be the hard-coded use of POSIX-style paths in the build script. When using the platform-appropriate path module, the issue is resolved for me.
A minimal reproduction is provided at https://github.com/j-maas/vite-build-path-windows-reproduction.
Additional context
I'm not sure, but I suspect that this might solve the similar issue from #7191. They opened #7192 to fix it, but it seems that their fix does not behave correctly, judging by the failing tests. However, if this PR is appropriate, it might be worth revisiting that issue and PR to potentially close them as fixed.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).