Relative CSS asset import does not work with root config set #18117
Labels
feat: css
p3-minor-bug
An edge case that only affects very specific usage (priority)
regression
The issue only appears after a new release
Describe the bug
#17856 broke relative CSS asset imports from node_modules when
root
config is set.vite/packages/vite/src/node/plugins/css.ts
Line 3032 in 37881e7
dep.loc.filePath
is used asimporter
, but that path is relative (../../node_modules/.pnpm/@fontsource
) and causes the asset path to be resolved to a path outside the project.Reproduction
https://github.com/Demivan/vite-css-asset-resolution-bug
Steps to reproduce
System Info
Used Package Manager
pnpm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: