-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 BUG: Vite plugins not applied in production (only in dev) #2039
Comments
The It's very likely we'll stop using this transformation in the future as we move to SSR where we can't rely on Vite doing HTML preprocessing. |
In case some one, like me, finds this issue: If I'm correct there's no way to apply code injections with such ease as My use case: I tried to inject scripts at the bottom of the page. Astro allows injection as described by type astro/packages/astro/src/@types/astro.ts Line 935 in ae41f25
but that's not fine for my use case, where I need to inject at the bottom, but opt-out of any transformations. Right now it's like shown: astro/packages/astro/src/core/build/generate.ts Lines 382 to 393 in 4b18813
and there's no api to alter generated html files |
Does the |
If |
|
What version of
astro
are you using?0.21.4
What package manager are you using?
npm
What operating system are you using?
Windows (reproduced in Linux)
Describe the Bug
When using a Vite plugin to transform page HTML the result is as expected when using the dev server (
astro dev
), but building the page (astro build
) results in Vite plugins not being applied.To reproduce: example below, after observing the automatically started dev server (correctly processing the HTML), stop the dev server, build the project, and inspect the generated HTML.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-5hwrzj-w68pe3?devtoolsheight=33&file=astro.config.mjs
The text was updated successfully, but these errors were encountered: