Replies: 2 comments
-
|
I did found a way, to basically inject |
Beta Was this translation helpful? Give feedback.
-
Try the See these examples: |
Beta Was this translation helpful? Give feedback.
-
|
I did found a way, to basically inject |
Beta Was this translation helpful? Give feedback.
-
Try the See these examples: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m trying to write a custom Vite plugin for SvelteKit that modifies HTML when running
npm run dev— basically to inject some scripts and metadata automatically.The problem is: Vite never seems to detect or pass
app.htmlthrough the plugin system. I’ve tried usingtransform(),transformIndexHtml(), and other plugin hooks. The plugin triggers just fine for.sveltefiles and even for CSS likeapp.css, butapp.htmlis not getting passed.My
vite.config.tssetup:I expected
transformIndexHtmlor any other vite hook to catchapp.htmlthe way it does withindex.htmlor any other.sveltefiles normally. But nothing happens — it seems like SvelteKit bypasses that path completely.So my questions:
app.htmland commit to it.Would appreciate any clarity on this, and what the recommended approach is if I want to achieve it.
Beta Was this translation helpful? Give feedback.
All reactions