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
In Astro we are updating to use vite:css-post for bundling instead of doing it our own thanks to the new viteMetadata property.
One thing that this plugin does is when there is a CSS chunk that only contains CSS, the JS bundle gets removed and any imports of that bundle are removed.
It uses a regexp to find import statements to remove. That code is here. However the code assumes the import statement is using double quotes.
I'm not sure why, but in Astro these become double quotes. As far as I can tell this isn't something Rollup lets you control. I'm not sure why it is happening, perhaps because we bundle to ESM?
Updating this regex to work with either single or double quotes would fix the issue. I'm willing to submit a PR to fix.
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/core instead.
Describe the bug
In Astro we are updating to use
vite:css-post
for bundling instead of doing it our own thanks to the newviteMetadata
property.One thing that this plugin does is when there is a CSS chunk that only contains CSS, the JS bundle gets removed and any imports of that bundle are removed.
It uses a regexp to find import statements to remove. That code is here. However the code assumes the import statement is using double quotes.
I'm not sure why, but in Astro these become double quotes. As far as I can tell this isn't something Rollup lets you control. I'm not sure why it is happening, perhaps because we bundle to ESM?
Updating this regex to work with either single or double quotes would fix the issue. I'm willing to submit a PR to fix.
Reproduction
https://github.com/withastro/astro/runs/6595302507?check_suite_focus=true
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: