Replies: 3 comments 1 reply
-
Seems related to withastro/astro#2039 |
Beta Was this translation helpful? Give feedback.
-
I'm unsure if your issue is related to the bug you've cited or not, but I was also trying to affect my build the other day by passing the If your issue is not related to the bug, perhaps this conversation could be expanded into one about better documentation for the Vite options. A few people seem to be spinning their wheels because they don't have an adequate mental model of what can be passed to Vite and what can't. IMHO, better documents here could help save some human cycles. https://docs.astro.build/en/reference/configuration-reference/#vite |
Beta Was this translation helpful? Give feedback.
-
Astro doesn't use Vite to emit the HTML, neither during build nor when server-rendering, so plugins targeting Vite's HTML output won't affect Astro. You can affect the Astro-generated HTML from an Astro middleware.
Be aware that doing so will break Astro functionality and possibly other libraries you might have. Many tools use HTML comments as markers, which is why most HTML minifiers won't remove them by default. |
Beta Was this translation helpful? Give feedback.
-
Astro already compresses html, but I was hoping to make use of the vite integration for further compression. I tried adding this plugin to the vite.plugins config, but I noticed that the final HTML still contains comments.
Do vite plugins which modify HTML work in Astro? How do I strip comments from the final HTML?
Beta Was this translation helpful? Give feedback.
All reactions