-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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): build project path error #9793
Conversation
packages/vite/src/node/build.ts
Outdated
if (input === 'index.html') { | ||
input = resolve(input) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't have a particular case for index.html
. This will be still broken for foo.html
. We need to check where input is being used which results in the paths being different on both platforms. Probably in the html
plugin, when computing these paths. I think we may be missing a normalizePath
. https://github.com/vitejs/vite/blob/main/packages/vite/src/node/plugins/html.ts#L929
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, thanks for the explanation
Thanks for the fix @btea! Would you try to add a test case so we avoid regressions in the future here? I think you should be able to add |
@patak-dev Hello, Could you help me add the test case? I don't know how to add it. Thanks! |
Whoops I didn't see the comment before approving 😅 @btea it should be setting the input like https://github.com/JiPaix/Fukayo/blob/183069a81a17b9b651261d374a253641edf59a73/packages/renderer/vite.config.js#L50 in the assets playground, which should be all that's need I think. |
@bluwy Hi, did I misunderstand what you meant? After I updated the code, the ci failed 😅 |
Oh, sorry @btea, looks like |
This reverts commit c4c5021.
same output with |
@patak-dev @JiPaix I tested it with wsl, the output is normal, the path does not contain |
@sapphi-red maybe you could try this one with a real Windows box there? |
It's working for me. export default {
base: './',
build: {
rollupOptions: {
input: 'index.html'
}
}
} Build result (index.html) with both Windows and WSL: <script type="module" crossorigin src="./assets/index.0771aa93.js"></script>
<link rel="stylesheet" href="./assets/index.d0964974.css"> |
@JiPaix would you provide a minimal reproduction of your issue with this PR? |
Nvm it works, i was doing something wrong... |
Description
fix #9771
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).