-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: scripts and styles were missing from built HTML on Windows #16421
Conversation
…aration characters exists than on POSIX filesystems (this fixes vitejs#15992)
|
I applied my changes so that it works and added a test. |
/ecosystem-ci run |
📝 Ran ecosystem CI on
✅ analogjs, astro, histoire, ladle, laravel, marko, nuxt, previewjs, quasar, qwik, rakkas, remix, sveltekit, unocss, vike, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-pages, vite-plugin-react-swc, vite-plugin-svelte, vite-plugin-vue, vite-setup-catalogue, vitepress |
Still not working on v5.4.2 with NodeJS 18 and MacOS 14.6.1 |
@vuletuanbt Please create a new issue with a minimal reproduction. Otherwise, your comment here will get lost and not be properly tracked. |
Description
Fix HTML entry file generation under Windows where different path
separation characters exists than on POSIX filesystems. This fixes issue
#15992.
The bug was not present in Vite 5.0.12, but still exists in 5.2.8.
I've traced it down to a bug in Vite which is related to path
handling and manifests itself only under Windows filesystems. The
chunk.facadeModuleId
is something likeC:\Users\rse\xxx\index.html
(the Windows path separation characters are in place) and the
id
isC:/Users/rse/xxx/index.html
(where POSIX path separation charactersare in place). As a result, the chunk is not found and hence the
tags not emitted during the HTML generation.
The workaround by using
path.resolve()
on thebuild.rollupOptions.input
works, but it would be better if thecomparison inside Vite is fixed. This is what this PR attempts to do.