-
-
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
Incorrect manifest entries for CSS entry points #14271
Comments
Start a new pull request in StackBlitz Codeflow. |
I'm not sure what the expected behavior is. /cc @sun0day |
@sapphi-red I'd expect the number of I see what you mean, and I guess |
I agree with @sapphi-red too. Even with the I think it's best to document this instead. My bad for the mislabelling. |
I had to set Imho, all entry points should have priority on their filename over imports from other languages like JS because those JS imports will be dynamically loaded anyways while entry points absolutely must have stable output filenames. |
Describe the bug
When I include a CSS file as an entry point (for example, when building styles for pages that use server-side templating), I'd expect Vite to generate a corresponding CSS file entry in the manifest. Instead, it generates an empty JS file on the relevant path and a separate entry for the CSS file placed in the "root".
Here's a minimal
vite.config.js
:Here's the manifest Vite generates:
You can see that the key
web/src/style.css
(which, according to the docs, can be used as a key into the manifest to have dev/prod parity) maps tostatic/vite/style-4ed993c7.js
, which is an empty JS file. There is an entry for juststyle.css
that points to the correct file, but it seems inconsistent with the rest of the manifest.This problem is very reminiscent of what @jessarcher observed in a related PR, but the PR makes it sound like it was fixed at the time, so maybe it's a regression.
Reproduction
https://stackblitz.com/edit/vitejs-vite-kx9tp7?file=build%2Fweb%2Fvite-manifest.json
Steps to reproduce
vite build
in the stackblitz aboveSystem Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 16.20.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 9.4.2 - /usr/local/bin/npm pnpm: 8.6.10 - /usr/local/bin/pnpm npmPackages: vite: ^4.4.9 => 4.4.9
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: