Skip to content

Regression in CSS output location #15141

@benmccann

Description

@benmccann

Describe the bug

CSS is output to a different location. That location doesn't match the location in the manifest and the change in location breaks SvelteKit users upgrading to Vite 5 because it breaks relative links to font files and potentially other assets: sveltejs/kit#11085

We could work around it on the SvelteKit side by changing the left hand side of the input object in the Vite config, but the workarounds have some issues. E.g. I could replace / with _, but then the file names get to be awkwardly long and show up differently in the Chrome network tab. If I try to just strip the portion before / then I run into the danger of overwriting the input entries for files with the same name living in different directories.

Reproduction

https://github.com/benmccann/vite5-css-reproduction

Steps to reproduce

pnpm install && pnpm build

Vite 5 produces CSS at dist/assets/lib/example-XpY97b8p.css

Vite 4 produces CSS at dist/assets/example-507eca81.css

System Info

Vite 5.0.2 compared to Vite 4.5.0

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions