You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This works fine
// import raw from './style.css?raw';
// This works too
// import raw from '@fontsource/inter/package.json?raw';
// This fails
import raw from '@fontsource/inter/index.css?raw';
I believe that's because vite:css plugin tries to transform code irrespective of if it's a special query (probably affects ?url as well ?). I can submit a PR to skip transform in vite:css if it's a special query (or just on ?raw).
(in raw case, vite:css fails parsing the code as it's JS export default "..." and not CSS)
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
Describe the bug
As the title says:
I believe that's because
vite:css
plugin tries to transform code irrespective of if it's a special query (probably affects ?url as well ?). I can submit a PR to skip transform in vite:css if it's a special query (or just on ?raw).(in raw case, vite:css fails parsing the code as it's JS
export default "..."
and not CSS)Reproduction
main.js
Result: https://stackblitz.com/edit/vite-59yl1g
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: